bundles: use metastack syntax for metadata.get()
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
4be912ac31
commit
b06532241b
38 changed files with 58 additions and 58 deletions
|
@ -1,4 +1,4 @@
|
|||
% for user, config in sorted(node.metadata.get('icinga2', {}).get('api_users', {}).items()):
|
||||
% for user, config in sorted(node.metadata.get('icinga2/api_users', {}).items()):
|
||||
object ApiUser "${user}" {
|
||||
password = "${config['password']}"
|
||||
permissions = [ "${'", "'.join(sorted(config['permissions']))}" ]
|
||||
|
|
|
@ -9,7 +9,7 @@ object ScheduledDowntime "unattended_upgrades" {
|
|||
fixed = true
|
||||
|
||||
ranges = {
|
||||
"${days[monitored_node.metadata.get('apt', {}).get('unattended_upgrades', {}).get('day', 5)]}" = "01:${monitored_node.magic_number%30}-01:${(monitored_node.magic_number%30)+30}"
|
||||
"${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"
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
object Host "${monitored_node.name}" {
|
||||
import "generic-host"
|
||||
|
||||
address = "${monitored_node.metadata.get('icinga_options', {}).get('hostname', monitored_node.hostname)}"
|
||||
address = "${monitored_node.metadata.get('icinga_options/hostname', monitored_node.hostname)}"
|
||||
|
||||
vars.os = "${monitored_node.os}"
|
||||
vars.sla = "${monitored_node.metadata.get('sla', '24x7')}"
|
||||
vars.period = "${sla_info[monitored_node.metadata.get('sla', '24x7')]}"
|
||||
vars.location = "${monitored_node.metadata.get('location', 'unknown')}"
|
||||
vars.bw_groups = [ "${'", "'.join(sorted({group.name for group in monitored_node.groups}))}" ]
|
||||
vars.notification.sms = ${str(monitored_node.metadata.get('icinga_options', {}).get('vars.notification.sms', True)).lower()}
|
||||
vars.notification.sms = ${str(monitored_node.metadata.get('icinga_options/vars.notification.sms', True)).lower()}
|
||||
vars.notification.mail = true
|
||||
}
|
||||
% endfor
|
||||
|
|
|
@ -2,7 +2,7 @@ object UserGroup "on-call_sms" {
|
|||
display_name = "On-Call Support (with SMS)"
|
||||
}
|
||||
|
||||
% for username, config in sorted(node.metadata.get('icinga2', {}).get('icinga_users', {}).items()):
|
||||
% for username, config in sorted(node.metadata.get('icinga2/icinga_users', {}).items()):
|
||||
object User "${username}" {
|
||||
display_name = "${username}"
|
||||
enable_notifications = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue