From c6aea06e718a0d456d2ba7fa3bbe5886b3c8c28f Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 21 Feb 2013 16:58:01 -0300 Subject: Adding source parameter to supervisor::app --- manifests/app.pp | 21 ++++++++++++++++----- 1 file 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'], } -- cgit v1.2.3