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

74 lines
1.7 KiB
Text
Raw Normal View History

2021-01-03 15:10:04 +00:00
# {{ ansible_managed }}
{% for name, command in icinga2_check_commands.items() %}
object CheckCommand "{{ name }}" {
command = {{ command.command }}
{% if command.arguments is defined %}
arguments = {
{% for argument in command.arguments %}
"{{ argument.name }}" = {
{% if argument.value is defined %}
value = "{{ argument.value }}"
{% else %}
set_if = "{{ argument.set_if }}"
{% endif %}
{% if argument.description is defined %}
description = "{{ argument.description }}"
{% endif %}
{% if argument.required is defined and argument.required %}
required = true
{% endif %}
}
{% endfor %}
}
{% endif %}
{% if command.vars is defined %}
var = {
{% for var, value in command.vars.items() %}
{{ var }} = {% if value is number %}{{ value }}{% else %}"{{ value }}"{% endif %}
{% endfor %}
}
{% endif %}
}
{% endfor %}
{% for name, command in icinga2_event_commands.items() %}
object EventCommand "{{ name }}" {
command = {{ command.command }}
{% if command.arguments is defined %}
arguments = {
{% for argument in command.arguments %}
"{{ argument.name }}" = {
{% if argument.value is defined %}
value = "{{ argument.value }}"
{% else %}
set_if = "{{ argument.set_if }}"
{% endif %}
{% if argument.description is defined %}
description = "{{ argument.description }}"
{% endif %}
{% if argument.required is defined and argument.required %}
required = true
{% endif %}
}
{% endfor %}
}
{% endif %}
{% if command.vars is defined %}
var = {
{% for var, value in command.vars.items() %}
{{ var }} = {% if value is number %}{{ value }}{% else %}"{{ value }}"{% endif %}
{% endfor %}
}
{% endif %}
}
{% endfor %}