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

33 lines
810 B
Text
Raw Normal View History

2021-01-03 15:10:04 +00:00
// {{ ansible_managed }}
object {{ item.value.object }} "{{ item.key }}" {
{% if item.value.config is defined %}
{% for option, value in item.value.config.items() %}
{% if value is sameas true %}
{{ option }} = true
{% elif value is sameas false %}
{{ option }} = false
{% elif value is string %}
{{ option }} = "{{ value }}"
{% elif value is number or value|regex_search('^[0-9]+(s|m|h|d)$') %}
{{ option }} = {{ value }}
{% elif value is mapping %}
{{ option }} = {
{% for k, v in value.iteritems() %}
{% if v is sameas true %}
{{ k }} = true
{% elif v is sameas false %}
{{ k }} = false
{% elif v is string %}
{{ k }} = "{{ v }}"
{% elif v is number or v|regex_search('^[0-9]+(s|m|h|d)$') %}
{{ k }} = {{ v }}
{% endif %}
{% endfor %}
}
{% endif %}
{% endfor %}
{% endif %}
}