Skip to content

Commit

Permalink
Merge pull request #32 from mattiasgeniar/master
Browse files Browse the repository at this point in the history
Style + documentation improvements
  • Loading branch information
plathrop committed Feb 15, 2013
2 parents c508fbe + 83929dd commit 8c490ae
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 51 deletions.
45 changes: 23 additions & 22 deletions manifests/init.pp
Expand Up @@ -95,30 +95,31 @@
# Sample Usage:
# class { 'supervisor': }
#
# Notes:
# You should always invoke the supervisor::service definition instead. Check that readme.
#
# [Remember: No empty lines between comments and class definition]
class supervisor(
$ensure = 'present',
$autoupgrade = false,
$service_ensure = 'running',
$service_enable = true,
$enable_inet_server = false,
$inet_server_port = '*:9000',
$inet_server_user = undef,
$inet_server_pass = undef,
$logfile = '/var/log/supervisor/supervisord.log',
$logfile_maxbytes = '500MB',
$logfile_backups = 10,
$log_level = 'info',
$minfds = 1024,
$minprocs = 200,
$childlogdir = '/var/log/supervisor',
$nocleanup = false,
$user = undef,
$umask = '022',
$supervisor_environment = undef,
$identifier = undef,
$recurse_config_dir = false
$ensure = 'present',
$autoupgrade = false,
$service_ensure = 'running',
$service_enable = true,
$enable_inet_server = false,
$inet_server_port = '*:9000',
$inet_server_user = undef,
$inet_server_pass = undef,
$logfile = '/var/log/supervisor/supervisord.log',
$logfile_maxbytes = '500MB',
$logfile_backups = 10,
$log_level = 'info',
$minfds = 1024,
$minprocs = 200,
$childlogdir = '/var/log/supervisor',
$nocleanup = false,
$user = undef,
$umask = '022',
$supervisor_environment = undef,
$identifier = undef,
$recurse_config_dir = false
) inherits supervisor::params {

include supervisor::update
Expand Down
12 changes: 6 additions & 6 deletions manifests/params.pp
@@ -1,16 +1,16 @@
class supervisor::params {
case $::operatingsystem {
'ubuntu','debian': {
$conf_file = '/etc/supervisor/supervisord.conf'
$conf_dir = '/etc/supervisor'
$conf_file = '/etc/supervisor/supervisord.conf'
$conf_dir = '/etc/supervisor'
$system_service = 'supervisor'
$package = 'supervisor'
$package = 'supervisor'
}
'centos','fedora','redhat': {
$conf_file = '/etc/supervisord.conf'
$conf_dir = '/etc/supervisord.d'
$conf_file = '/etc/supervisord.conf'
$conf_dir = '/etc/supervisord.d'
$system_service = 'supervisord'
$package = 'supervisor'
$package = 'supervisor'
}
default: {
fail("Unsupported platform: ${::operatingsystem}")
Expand Down
58 changes: 35 additions & 23 deletions manifests/service.pp
@@ -1,28 +1,40 @@
# Actions:
# Set up a daemon to be run by supervisor
#
# Sample Usage:
# supervisor::service { 'organizational_worker':
# command => '/usr/bin/php /var/www/vhosts/site/gearman/worker.php',
# numprocs => 2,
# numprocs_start => 1,
# user => 'org_user',
# group => 'org_group',
# }
#
define supervisor::service (
$command,
$ensure=present,
$enable=true,
$numprocs=1,
$numprocs_start=0,
$priority=999,
$autorestart='unexpected',
$startsecs=1,
$retries=3,
$exitcodes='0,2',
$stopsignal='TERM',
$stopwait=10,
$user='root',
$group='root',
$redirect_stderr=false,
$directory=undef,
$stdout_logfile=undef,
$stdout_logfile_maxsize='250MB',
$stdout_logfile_keep=10,
$stderr_logfile=undef,
$stderr_logfile_maxsize='250MB',
$stderr_logfile_keep=10,
$environment=undef,
$umask=undef
$ensure = present,
$enable = true,
$numprocs = 1,
$numprocs_start = 0,
$priority = 999,
$autorestart = 'unexpected',
$startsecs = 1,
$retries = 3,
$exitcodes = '0,2',
$stopsignal = 'TERM',
$stopwait = 10,
$user = 'root',
$group = 'root',
$redirect_stderr = false,
$directory = undef,
$stdout_logfile = undef,
$stdout_logfile_maxsize = '250MB',
$stdout_logfile_keep = 10,
$stderr_logfile = undef,
$stderr_logfile_maxsize = '250MB',
$stderr_logfile_keep = 10,
$environment = undef,
$umask = undef
) {
include supervisor

Expand Down

0 comments on commit 8c490ae

Please sign in to comment.