ansible-role-nagios/templates/host_template.j2

24 lines
499 B
Text
Raw Permalink Normal View History

2022-10-11 09:19:02 +02:00
# File managed by Ansible
# HOST DEFINITION
define host{
{% for key, value in item.items() %}
{% if key != "services" %}
{{ key }} {{ value }}
{% endif %}
{% endfor %}
}
{% if 'services' in item %}
# SERVICES DEFINITION
{% for service in item.services %}
define service{
host {{ item.host_name }}
{% for key, value in service.items() %}
{{ key }} {% if key == "service_description" %}{{ value | replace(" ", "_") }}{% else %}{{ value }}{% endif %}
{% endfor %}
}
{% endfor %}{% endif %}