Puppet Class: masterless::puppet::service
- Defined in:
- manifests/puppet/service.pp
Summary
A short summary of the purpose of this classOverview
A description of what this class does
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'manifests/puppet/service.pp', line 7
class masterless::puppet::service (
Enum['present', 'absent'] $ensure = 'present',
String[1] $user = $masterless::user,
String[1] $home = $masterless::home,
String[1] $plist = $masterless::plist
) {
include masterless::puppet::config
exec { 'reload_job':
command => "/bin/launchctl unload -w ${plist} && /bin/launchctl load -w ${plist}",
subscribe => File["${home}/.puppet-masterless/run.sh", $plist],
refreshonly => true,
}
if $ensure == 'present' {
exec { 'ensure_job_loaded':
command => "/bin/launchctl load -w ${plist}",
unless => "/bin/launchctl list | /usr/bin/grep com.github.puppet-masterless-${user}",
}
} else {
exec { 'ensure_job_unloaded':
command => "/bin/launchctl load -w ${plist}",
onlyif => "/bin/launchctl list | /usr/bin/grep com.github.puppet-masterless-${user}",
}
}
}
|