Puppet Class: psick::puppet::osp_agent
- Defined in:
- manifests/puppet/osp_agent.pp
Overview
This class manages Open Source Puppet Agent
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 |
# File 'manifests/puppet/osp_agent.pp', line 3
class psick::puppet::osp_agent (
Boolean $manage_installation = true,
Hash $tp_params = {},
Enum['present','absent'] $cronjob_ensure = 'absent',
String $cronjob_schedule = '0,30 * * * *',
Boolean $manage_service = true,
Enum['running','stopped'] $service_ensure = 'running',
Hash $settings = {},
String $config_template = 'psick/generic/inifile_with_stanzas.erb',
Boolean $manage = $psick::manage,
Boolean $noop_manage = $psick::noop_manage,
Boolean $noop_value = $psick::noop_value,
) {
if $manage {
if $noop_manage {
noop($noop_value)
}
# Manage Puppet agent service
if $manage_installation {
$local_params = {
'settings_hash' => {
service_ensure => $service_ensure,
},
manage_service => $manage_service,
}
tp::install { 'puppet-agent':
* => $local_params + $tp_params,
}
}
if $settings != {} {
tp::conf { 'puppet-agent':
content => psick::template($config_template),
}
}
if $facts['os']['kernel'] != 'windows' {
file { '/etc/cron.d/puppet-agent':
ensure => $cronjob_ensure,
content => "PATH=/opt/puppetlabs/puppet/bin:/usr/sbin:/usr/bin\n${cronjob_schedule} root puppet agent -t",
}
}
}
}
|