Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5079501

Browse files
author
Alex Crowe
committedDec 2, 2014
Merge pull request ajcrowe#28 from 3dna/supervisorctl_plugin
merged PR ajcrowe#28: added supervisord::ctlplugin
2 parents c86d313 + 9d52158 commit 5079501

File tree

5 files changed

+54
-0
lines changed

5 files changed

+54
-0
lines changed
 

‎README.md

+8
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ supervisord::group { 'mygroup':
9191
}
9292
```
9393

94+
### Configure a ctlplugin
95+
96+
```ruby
97+
supervisord::ctlplugin { 'laforge':
98+
ctl_factory => 'mr.laforge.controllerplugin:make_laforge_controllerplugin'
99+
}
100+
```
101+
94102
### Configure an eventlistener
95103

96104
```ruby

‎manifests/ctlplugin.pp

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Define: supervisord::ctlplugin
2+
#
3+
# This define creates a ctlplugin section in supervisord.conf
4+
#
5+
# Sadly, I have been unable to find any documentation or mention of this stanza type
6+
# in any of supervisord docs or code, but I am using it in production and it works.
7+
#
8+
#
9+
# Documentation on parameters available at:
10+
# http://supervisord.org/configuration.html#program-x-section-settings
11+
#
12+
define supervisord::ctlplugin(
13+
$ctl_factory,
14+
$ensure = present,
15+
) {
16+
include supervisord
17+
18+
# parameter validation
19+
validate_string($ctl_factory)
20+
21+
concat::fragment { "ctlplugin:${name}":
22+
target => $supervisord::config_file,
23+
content => template('supervisord/conf/ctlplugin.erb'),
24+
order => 70,
25+
}
26+
27+
}

‎spec/defines/ctlplugin_spec.rb

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require 'spec_helper'
2+
3+
describe 'supervisord::ctlplugin', :type => :define do
4+
let(:title) {'foo'}
5+
let (:facts) {{ :concat_basedir => '/var/lib/puppet/concat' }}
6+
7+
context 'default' do
8+
let(:params) { { :ctl_factory => 'bar.baz:make_bat' } }
9+
it { should contain_supervisord__ctlplugin('foo') }
10+
it { should contain_concat__fragment('ctlplugin:foo') \
11+
.with_content(/supervisor\.ctl_factory = bar\.baz:make_bat/) }
12+
end
13+
end

‎templates/conf/ctlplugin.erb

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[ctlplugin:<%= @name %>]
2+
supervisor.ctl_factory = <%= @ctl_factory %>
3+

‎tests/ctlplugin.pp

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
supervisord::ctlplugin { 'mr.laforge':
2+
ctl_factory => 'mr.laforge.controllerplugin:make_laforge_controllerplugin',
3+
}

0 commit comments

Comments
 (0)
This repository has been archived.