diff --git a/bundles/apt/metadata.py b/bundles/apt/metadata.py index d2db8f4..e274cc5 100644 --- a/bundles/apt/metadata.py +++ b/bundles/apt/metadata.py @@ -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, + ), + }, + }