bundles/apt: move patchday to metadata reactor, make patchday configurable
This commit is contained in:
parent
32b7dda61f
commit
0ca8edf656
1 changed files with 14 additions and 5 deletions
|
@ -1,9 +1,4 @@
|
||||||
defaults = {
|
defaults = {
|
||||||
'cron': {
|
|
||||||
'upgrade-and-reboot': '{minute} 1 * * 5 root /usr/local/sbin/upgrade-and-reboot'.format(
|
|
||||||
minute=node.magic_number % 30,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
'icinga2_api': {
|
'icinga2_api': {
|
||||||
'apt': {
|
'apt': {
|
||||||
'services': {
|
'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,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue