Version information
Start using this module
Add this module to your Puppetfile:
mod 'ajcrowe-supervisord', '0.3.3'
Learn more about managing modules with a PuppetfileDocumentation
Puppet Supervisord
Puppet module to manage the supervisord process control system.
Functions available to configure
Examples
Configuring supervisord with defaults
Install supervisord with pip and install an init script if available
include supervisord
Install supervisord and pip
Install supervisord and install pip if not available.
class supervisord {
$install_pip => true,
}
This will download setuptool and install pip with easy_install.
You can pass a specific url with $setuptools_url = 'url'
Note: Only Debian and RedHat families have an init script currently.
Configure a program
supervisord::program { 'myprogram':
command => 'command --args',
priority => '100',
environment => {
'HOME' => '/home/myuser',
'PATH' => '/bin:/sbin:/usr/bin:/usr/sbin',
'SECRET' => 'mysecret'
}
}
You may also specify a variable for a hiera lookup to retreive your environment hash. This allows you to reuse existing environment variable hashes.
supervisord::program { 'myprogram':
command => 'command --args',
priority => '100',
env_var => 'my_common_envs'
}
Configure a group
supervisord::group { 'mygroup':
priority => 100,
programs => ['program1', 'program2', 'program3']
}
Configure an eventlistener
supervisord::eventlistener { 'mylistener':
command => 'command --args',
events => ['PROCESS_STATE', 'PROCESS_STATE_START']
priority => '100',
env_var => 'my_common_envs'
}
Run supervisorctl Commands
Should you need to run a sequence of command with supervisorctl
you can use the define type supervisord::supervisorctl
supervisord::supervisorctl { 'restart_myapp':
command => 'restart',
process => 'myapp'
}
You can also issue a command without specifying a process.
Development
If you have suggestions or improvements please file an issue or pull request, i'll try and sort them as quickly as possble.
If you submit a pull please try and include tests for the new functionality/fix. The module is tested with Travis-CI.
Credits
- Debian init script sourced from the system package.
- RedHat/Centos init script sourced from https://github.com/Supervisor/initscripts
2014-06-06 - v0.3.3
Fixes:
- Fixed typo in stopwaitsec param, should have been stopwaitsecs, thanks to @rchrd2
2014-05-03 - v0.3.2
Changes:
- Added supervisord::executable_ctl variable for supervisorctl binary path, thanks to @bpgoldsb
2014-04-22 - v0.3.1
Fixes:
- Fixed typo in unix_socket_group param, thanks to @dig412
2014-03-11 - v0.3.0
Fixes:
- Fixed typo in fcgi config
- Fixed typo in supervisord config with minfds and minprocs, thanks to @peefourtee
- Typo in README fixed thanks to @hopkinsth
- Removed refreshonly from pip_install exec resource
- Number of syntax fixes thanks to
puppet lint
Important Changes:
- Lots of input validation has been added PLEASE check your config works before upgrading!
- Changed init_extras naming to defaults and cleaned things up.
- Starting and stopping apps is now done with supervisorctl commands to avoid service restarts
Other Changes:
- CSV functions now order things consistently
- Included description for classes and functions
- Expanded spec testing built with Travis CI
- Added beaker acceptance tests
- Added greater validation of various parameters
- Added coverage reporting for resources
To-Do:
- Add support for additional OS families such as Solaris.
2013-10-31 - v0.2.3
Fixes:
- Fixed large bug on debian wheezy where /var/run is changed from a symlink to a directory causing all pids to be inaccessible breaking lots of services
2013-10-30 - v0.2.2
Fixes:
- Fixed syntax error in README examples and tests
2013-10-16 - v0.2.1
Fixes:
- Fixed user params in templates
- Added missing environment support in main supervisord.conf
2013-10-15 - v0.2.0
Feature complete release
- Added Eventlistener template and function
- Added FGCI-Program template and function
- More consistent log naming and fixed missing new lines
2013-10-15 - v0.1.1
Fixes:
- Missing '=' in template tags when using certain parameters
- Added log file default to program define to avoid /tmp being used when not specified
- Fixed logic when not using environment variables in program
2013-10-15 - v0.1.0
Summary:
Completed basic module functionality for
- Install with pip
- Configure programs
- Configure groups
- Install init scripts for RedHat and Debian families
Dependencies
- puppetlabs/concat (>= 1.0.0 <2.0.0)
- puppetlabs/stdlib (>= 4.1.0)