]> gitweb.fluxo.info Git - puppet-supervisor.git/commitdiff
Adding source parameter to supervisor::app
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 21 Feb 2013 19:58:01 +0000 (16:58 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 21 Feb 2013 19:58:01 +0000 (16:58 -0300)
manifests/app.pp

index aef36d2fd8f903b97391c37a898c73acbcd1fe3c..30a422dc0f2f182f04a94426dd9128a538a8b583 100644 (file)
@@ -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'],
   }