ansible-pilote/templates/nagios/contacts.cfg.j2
Julien Riou 096a3e0540
Initial commit
Signed-off-by: Julien Riou <julien@riou.xyz>
2024-04-27 15:21:55 +02:00

35 lines
1.3 KiB
Django/Jinja

{{ ansible_managed | comment }}
{% for contact in nagios_contacts | default([]) %}
define contact {
contact_name {{ contact['contact_name'] }}
use {{ contact['use'] }}
alias {{ contact['alias'] }}
email {{ contact['email'] }}
{% if 'pager' in contact %}
pager {{ contact['pager'] }}
{% endif %}
{% if 'host_notifications_enabled' in contact %}
host_notifications_enabled {{ contact['host_notifications_enabled'] }}
{% endif %}
{% if 'service_notifications_enabled' in contact %}
service_notifications_enabled {{ contact['service_notifications_enabled'] }}
{% endif %}
{% if 'host_notification_commands' in contact %}
host_notification_commands {{ contact['host_notification_commands'] }}
{% endif %}
{% if 'service_notification_commands' in contact %}
service_notification_commands {{ contact['service_notification_commands'] }}
{% endif %}
}
{% endfor %}
{% for contact_group in nagios_contact_groups | default([]) %}
define contactgroup {
contactgroup_name {{ contact_group['contactgroup_name'] }}
alias {{ contact_group['alias'] }}
members {{ contact_group['members'] | sort | join(',') }}
}
{% endfor %}