bundlewrap/bundles/apt/metadata.py
Franziska Kunsmann 0ccb983b28
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
bundles/apt: fix metadata key mess (unattended-upgrades vs unattended_upgrades)
2022-01-23 05:47:42 +01:00

35 lines
867 B
Python

defaults = {
'apt': {
'unattended-upgrades': {
'day': 5,
'hour': 21,
},
},
'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')
hour = metadata.get('apt/unattended-upgrades/hour')
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,
),
},
}