aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-02-21 16:58:01 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-02-21 16:58:01 -0300
commitc6aea06e718a0d456d2ba7fa3bbe5886b3c8c28f (patch)
tree133566f523789ccbb8e78e022fd201be20abca19
parentcb7db31fccae01b80150ed5bf09fe43e7308581e (diff)
downloadpuppet-supervisor-c6aea06e718a0d456d2ba7fa3bbe5886b3c8c28f.tar.gz
puppet-supervisor-c6aea06e718a0d456d2ba7fa3bbe5886b3c8c28f.tar.bz2
Adding source parameter to supervisor::app
-rw-r--r--manifests/app.pp21
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'],
}