Open lucagubler opened 2 weeks ago
There's a bug when using the value or key variable in combination with apply_for loops. I want to loop over a dictionary or list and then use the key or value to access items.
value
key
apply_for
Here's an example service
... - name: Check BGP VRF- + value.description type: Service display_name: Check BGP VRF- + value.description file: zones.d/main/services/services.conf apply: true apply_for: key => value in host.vars.nb.config.bgp_sessions.vrf imports: - generic-service check_command: check_nwc_health assign: - host.vars.nb.platform == slx-os vars: check_nwc_mode: bgp-peer-status snmp_v3_context: key ...
here's the rendered Icinga2 object. Please note the quotes around value.description.
value.description
apply Service for (key => value in host.vars.nb.config.bgp_sessions.vrf) { import "generic-service" display_name = "Check BGP VRF-" + "value.description" check_command = "check_nwc_health" assign where host.vars.nb.platform == "slx-os" vars.check_nwc_mode = "bgp-peer-status" vars.snmp_v3_context = key }
These quotes need to be removed so that the GUI correctly displays the monitored services.
There's a bug when using the
value
orkey
variable in combination withapply_for
loops. I want to loop over a dictionary or list and then use thekey
orvalue
to access items.Here's an example service
here's the rendered Icinga2 object. Please note the quotes around
value.description
.These quotes need to be removed so that the GUI correctly displays the monitored services.