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', ; } } }