summaryrefslogtreecommitdiff
path: root/manifests/service.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/service.pp')
-rw-r--r--manifests/service.pp33
1 files changed, 24 insertions, 9 deletions
diff --git a/manifests/service.pp b/manifests/service.pp
index 56433fd..3258bec 100644
--- a/manifests/service.pp
+++ b/manifests/service.pp
@@ -1,14 +1,26 @@
define runit::service (
- $user = root, # the service's user name
- $group = root, # the service's group name
- $enable = true, # shall the service be linked to /etc/service
- $ensure = present, # shall the service be present in /etc/sv
- $logger = false, # shall we setup an logging service
- # either one of these must be given:
- $source = undef, # either source or content must be defined;
- $content = undef # this will be the run script /etc/sv/$name/run
+ $user = root, # the service's user name
+ $group = root, # the service's group name
+ $enable = true, # shall the service be linked to /etc/service
+ $ensure = present, # shall the service be present in /etc/sv
+ # either one of these three must be declared - it defines the content of the run script /etc/sv/$name/run
+ $commmand = undef, # the most simple way; just state command here - it may not daemonize itself,
+ # but rather stay in the foreground; all output is logged automatically to $logdir/current
+ # this uses a default template which provides logging
+ $source = undef, # specify a source file on your puppet master
+ $content = undef, # specify the content directly (mostly via 'template')
+ # service directory - this is required if you use 'command'
+ $rundir = undef,
+ # logging stuff
+ $logger = false, # shall we setup an logging service; if you use 'command' before,
+ # all output from command will be logged automatically to $logdir
+ $logdir = $svdir # override logging directory
) {
+ # FixMe: Validate parameters
+ # fail("Only one of 'command', 'content', or 'source' parameters is allowed")
+
+
# resource defaults
File { owner => root, group => root, mode => 644 }
@@ -32,7 +44,10 @@ define runit::service (
purge => true,
;
"${svbase}/run":
- content => $content,
+ content => $content ? {
+ undef => template('runit/run.erb'),
+ default => $content,
+ },
source => $source,
ensure => $ensure,
mode => 755,