diff options
-rw-r--r-- | manifests/app.pp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/manifests/app.pp b/manifests/app.pp index aef36d2..30a422d 100644 --- a/manifests/app.pp +++ b/manifests/app.pp @@ -1,19 +1,30 @@ define supervisor::app ( - $command, - $directory, + $command = false, + $directory = false, $appname = $name, $ensure = running, $user = 'www-data', + $source = '' ) { - + $conf_title = "supervisor-${appname}" $service_title = $conf_title file { $conf_title: path => "/etc/supervisor/conf.d/${appname}.conf", ensure => present, - content => template('supervisor/app.erb'), - require => Package['supervisor'], + owner => root, + group => root, + mode => 0644, + content => $source ? { + '' => template('supervisor/app.erb'), + default => undef, + }, + source => $source ? { + '' => undef, + default => $source, + }, + require => [ File['/etc/supervisor/conf.d'], notify => Service['supervisor'], } |