2020-10-18 13:33:41 +00:00
|
|
|
defaults = {
|
2020-11-10 08:50:20 +00:00
|
|
|
'icinga2_api': {
|
|
|
|
'apt': {
|
|
|
|
'services': {
|
|
|
|
'UNATTENDED UPGRADES': {
|
|
|
|
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_unattended_upgrades',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-10-18 13:33:41 +00:00
|
|
|
}
|
2020-11-14 11:24:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
@metadata_reactor
|
|
|
|
def patchday(metadata):
|
|
|
|
day = metadata.get('apt/unattended_upgrades/day', 5)
|
|
|
|
|
|
|
|
return {
|
|
|
|
'cron': {
|
|
|
|
'upgrade-and-reboot': '{minute} 1 * * {day} root /usr/local/sbin/upgrade-and-reboot'.format(
|
|
|
|
minute=node.magic_number % 30,
|
|
|
|
day=day,
|
|
|
|
),
|
|
|
|
},
|
|
|
|
}
|