summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/managed_service.pp42
1 files changed, 42 insertions, 0 deletions
diff --git a/manifests/managed_service.pp b/manifests/managed_service.pp
new file mode 100644
index 0000000..4140f7b
--- /dev/null
+++ b/manifests/managed_service.pp
@@ -0,0 +1,42 @@
+define s6::managed_service (
+ String $service_dir,
+ String $scan_dir,
+ String $runscript,
+ Optional[String] $finishscript = undef,
+ Optional[String] $logger_runscript = undef,
+) {
+ file {
+ "${service_dir}/${name}":
+ ensure => directory,
+ ;
+ "${service_dir}/${name}/run":
+ ensure => present,
+ content => $runscript,
+ mode => '0755',
+ ;
+ }
+ if $finishscript {
+ file {
+ "${service_dir}/${name}/finish":
+ ensure => present,
+ content => $finishscript,
+ mode => '0755',
+ ;
+ }
+ }
+ if $logger_runscript {
+ file {
+ "${service_dir}/var/log/s6/${name}":
+ ensure => directory,
+ ;
+ "${service_dir}/${name}/log":
+ ensure => directory,
+ ;
+ "${service_dir}/${name}/log/run":
+ ensure => present,
+ content => $logger_runscript,
+ mode => '0755',
+ ;
+ }
+ }
+}