ansible-role-icinga2/templates/dependencies.conf.j2

29 lines
914 B
Text
Raw Normal View History

2022-11-09 13:11:22 +00:00
# {{ ansible_managed }}
{% for name, dependency in icinga2_dependencies.items() %}
apply Dependency "{{ name }}" to Service {
{% if dependency.parent_host_name is defined %}
{% if dependency.parent_host_name == "host.name" %}
parent_host_name = host.name
{% else %}
parent_host_name = {{ dependency.parent_host_name }}
{% endif %}
{% endif %}
{% for option in ['parent_service_name', 'child_host_name', 'child_service_name' 'period'] %}
{% if dependency[option] is defined %}
{{ option }} = "{{ dependency[option] }}"
{% endif %}
{% endfor %}
{% for option in ['disable_checks', 'disable_notifications', 'ignore_soft_states'] %}
{% if dependency[option] is defined %}
{{ option }} = {{ dependency[option] | ternary("true", "false") }}
{% endif %}
{% endfor %}
{% if dependency.states is defined %}
states = [ {{ value | join(', ') }} ]
{% endif %}
assign where {{ dependency.assign }}
}
{% endfor %}