bundles/apt: move patchday to metadata reactor, make patchday configurable

This commit is contained in:
Franzi 2020-11-14 12:24:55 +01:00
parent 32b7dda61f
commit 0ca8edf656
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -1,9 +1,4 @@
defaults = {
'cron': {
'upgrade-and-reboot': '{minute} 1 * * 5 root /usr/local/sbin/upgrade-and-reboot'.format(
minute=node.magic_number % 30,
),
},
'icinga2_api': {
'apt': {
'services': {
@ -14,3 +9,17 @@ defaults = {
},
},
}
@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,
),
},
}