bundles/icinga2: introduce icinga_options/downtime_also_for
All checks were successful
bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2021-04-17 03:43:08 +02:00
parent 6a88040826
commit 4d5e75df68
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 23 additions and 0 deletions

View file

@ -14,5 +14,21 @@ object ScheduledDowntime "unattended_upgrades" {
child_options = "DowntimeTriggeredChildren"
}
% for also_host in sorted(monitored_node.metadata.get('icinga_options/downtime_also_for', set())):
object ScheduledDowntime "unattended_upgrades_also_for_${also_host}" {
host_name = "${repo.get_node(also_host).name}"
author = "upgrade-and-reboot"
comment = "Downtime for upgrade-and-reboot of ${monitored_node.name}"
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}"
}
child_options = "DowntimeTriggeredChildren"
}
% endfor
% endif
% endfor

View file

@ -50,6 +50,13 @@ nodes['home.nas'] = {
'groups': {
'nas': {},
},
'icinga_options': {
'downtime_also_for': {
# FIXME maybe autogenerate that from bundle:vmhost?
'home.router',
'home.downloadhelper',
},
},
'iptables': {
'port_rules': {
'4679': { # Dell ULNM