From 7775f33679294d4593cf23649fcba22698daa3a2 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Thu, 13 May 2021 09:10:33 +0200 Subject: [PATCH] bundles/apt: move patchday to 21:00 UTC --- bundles/apt/metadata.py | 10 ++++++++-- bundles/c3voc-addons/metadata.py | 10 ++++++++-- bundles/icinga2/files/icinga2/downtimes.conf | 2 +- nodes/home/kodi-wohnzimmer.py | 14 +++++++++----- nodes/voc/pretalx.py | 1 - 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/bundles/apt/metadata.py b/bundles/apt/metadata.py index 5e55b0c..ecb0775 100644 --- a/bundles/apt/metadata.py +++ b/bundles/apt/metadata.py @@ -1,4 +1,10 @@ defaults = { + 'apt': { + 'unattended_upgrades': { + 'day': 5, + 'hour': 21, + }, + }, 'icinga2_api': { 'apt': { 'services': { @@ -15,8 +21,8 @@ defaults = { 'cron/upgrade-and-reboot' ) def patchday(metadata): - day = metadata.get('apt/unattended_upgrades/day', 5) - hour = metadata.get('apt/unattended_upgrades/hour', 1) + day = metadata.get('apt/unattended_upgrades/day') + hour = metadata.get('apt/unattended_upgrades/hour') return { 'cron': { diff --git a/bundles/c3voc-addons/metadata.py b/bundles/c3voc-addons/metadata.py index 50f0571..e0947c7 100644 --- a/bundles/c3voc-addons/metadata.py +++ b/bundles/c3voc-addons/metadata.py @@ -1,4 +1,10 @@ defaults = { + 'apt': { + 'unattended_upgrades': { + 'day': 5, + 'hour': 21, + }, + }, 'icinga2_api': { 'apt': { 'services': { @@ -22,8 +28,8 @@ defaults = { 'cron/upgrade-and-reboot' ) def patchday(metadata): - day = metadata.get('apt/unattended_upgrades/day', 5) - hour = metadata.get('apt/unattended_upgrades/hour', 1) + day = metadata.get('apt/unattended_upgrades/day') + hour = metadata.get('apt/unattended_upgrades/hour') return { 'cron': { diff --git a/bundles/icinga2/files/icinga2/downtimes.conf b/bundles/icinga2/files/icinga2/downtimes.conf index a301239..421ffd8 100644 --- a/bundles/icinga2/files/icinga2/downtimes.conf +++ b/bundles/icinga2/files/icinga2/downtimes.conf @@ -9,7 +9,7 @@ object ScheduledDowntime "unattended_upgrades" { fixed = true ranges = { - "${days[monitored_node.metadata.get('apt/unattended_upgrades/day', 5)]}" = "01:${monitored_node.magic_number%30}-01:${(monitored_node.magic_number%30)+30}" + "${days[monitored_node.metadata.get('apt/unattended_upgrades/day')]}" = "${monitored_node.metadata.get('apt/unattended_upgrades/hour')}:${monitored_node.magic_number%30}-${monitored_node.metadata.get('apt/unattended_upgrades/hour')}:${(monitored_node.magic_number%30)+30}" } child_options = "DowntimeTriggeredChildren" diff --git a/nodes/home/kodi-wohnzimmer.py b/nodes/home/kodi-wohnzimmer.py index 8635a06..8d92f12 100644 --- a/nodes/home/kodi-wohnzimmer.py +++ b/nodes/home/kodi-wohnzimmer.py @@ -9,6 +9,15 @@ nodes['home.kodi-wohnzimmer'] = { 'debian-buster', }, 'metadata': { + 'apt': { + 'packages': { + 'intel-media-va-driver-non-free': {}, + }, + 'unattended_upgrades': { + 'day': 6, + 'hour': 2, + }, + }, 'interfaces': { 'eno1': { 'ips': { @@ -17,11 +26,6 @@ nodes['home.kodi-wohnzimmer'] = { 'gateway4': '172.19.138.1', }, }, - 'apt': { - 'packages': { - 'intel-media-va-driver-non-free': {}, - }, - }, 'backup-client': { 'server': '172.19.138.20:22', }, diff --git a/nodes/voc/pretalx.py b/nodes/voc/pretalx.py index 3058014..2f6f708 100644 --- a/nodes/voc/pretalx.py +++ b/nodes/voc/pretalx.py @@ -18,7 +18,6 @@ nodes['voc.pretalx'] = { # clashing with actual events is less likely. 'unattended_upgrades': { 'day': 1, - 'hour': 21, }, }, 'interfaces': {