bundlewrap/bundles/apt/metadata.py

29 lines
763 B
Python

defaults = {
'icinga2_api': {
'apt': {
'services': {
'UNATTENDED UPGRADES': {
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_unattended_upgrades',
},
},
},
},
}
@metadata_reactor.provides(
'cron/upgrade-and-reboot'
)
def patchday(metadata):
day = metadata.get('apt/unattended_upgrades/day', 5)
hour = metadata.get('apt/unattended_upgrades/hour', 1)
return {
'cron': {
'upgrade-and-reboot': '{minute} {hour} * * {day} root /usr/local/sbin/upgrade-and-reboot'.format(
minute=node.magic_number % 30,
hour=hour,
day=day,
),
},
}