Puppet Class: puppet::agent::service
- Defined in:
- manifests/agent/service.pp
Overview
Set up the puppet agent as a service
3 4 5 6 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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'manifests/agent/service.pp', line 3
class puppet::agent::service {
case $puppet::runmode {
'service': {
$service_enabled = true
$cron_enabled = false
$systemd_enabled = false
}
'cron': {
$service_enabled = false
$cron_enabled = true
$systemd_enabled = false
}
'systemd.timer': {
$service_enabled = false
$cron_enabled = false
$systemd_enabled = true
}
'none', 'unmanaged': {
$service_enabled = false
$cron_enabled = false
$systemd_enabled = false
}
default: {
fail("Runmode of ${puppet::runmode} not supported by puppet::agent::config!")
}
}
if $puppet::runmode in $puppet::unavailable_runmodes {
fail("Runmode of ${puppet::runmode} not supported on ${facts['kernel']} operating systems!")
}
class { 'puppet::agent::service::daemon':
enabled => $service_enabled,
}
contain puppet::agent::service::daemon
class { 'puppet::agent::service::systemd':
enabled => $systemd_enabled,
hour => $puppet::run_hour,
minute => $puppet::run_minute,
}
contain puppet::agent::service::systemd
class { 'puppet::agent::service::cron':
enabled => $cron_enabled,
hour => $puppet::run_hour,
minute => $puppet::run_minute,
}
contain puppet::agent::service::cron
}
|