bundles/apt: add option to configure patch-hour, not only patchday

This commit is contained in:
Franzi 2021-02-12 18:53:25 +01:00
parent 17dbba2c94
commit c0353d2911
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 6 additions and 2 deletions

View file

@ -16,11 +16,13 @@ defaults = {
)
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} 1 * * {day} root /usr/local/sbin/upgrade-and-reboot'.format(
'upgrade-and-reboot': '{minute} {hour} * * {day} root /usr/local/sbin/upgrade-and-reboot'.format(
minute=node.magic_number % 30,
hour=hour,
day=day,
),
},

View file

@ -23,11 +23,13 @@ defaults = {
)
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} 1 * * {day} root /usr/local/sbin/upgrade-and-reboot'.format(
'upgrade-and-reboot': '{minute} {hour} * * {day} root /usr/local/sbin/upgrade-and-reboot'.format(
minute=node.magic_number % 30,
hour=hour,
day=day,
),
},