Puppet Class: psick::update
- Defined in:
- manifests/update.pp
Overview
This class managed system’s packages updates via cron
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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'manifests/update.pp', line 26
class psick::update (
Optional[String] $cron_schedule = undef,
Boolean $reboot_after_update = false,
String $update_template = 'psick/update/update.sh.erb',
String $update_script_path = '/usr/local/sbin/update.sh',
Boolean $use_yum_cron = false,
Boolean $manage = $psick::manage,
Boolean $noop_manage = $psick::noop_manage,
Boolean $noop_value = $psick::noop_value,
) {
if $manage {
if $noop_manage {
noop($noop_value)
}
if $facts['os']['family'] == 'RedHat' and $use_yum_cron {
contain psick::yum::cron
file { '/etc/cron.d/system_update':
ensure => absent,
}
} else {
# Custom update script
if $cron_schedule {
file { '/etc/cron.d/system_update':
ensure => file,
content => "# File managed by Puppet\n${cron_schedule} root ${update_script_path}\n",
}
} else {
file { '/etc/cron.d/system_update':
ensure => absent,
}
}
file { $update_script_path:
ensure => file,
mode => '0750',
content => template($update_template),
before => File['/etc/cron.d/system_update'],
}
}
}
}
|