diff --git a/playbooks/tasks/web/nagios-ansible.cfg.j2 b/playbooks/tasks/web/nagios-ansible.cfg.j2 index 7c5e9aa..3579f6f 100644 --- a/playbooks/tasks/web/nagios-ansible.cfg.j2 +++ b/playbooks/tasks/web/nagios-ansible.cfg.j2 @@ -113,12 +113,13 @@ define hostgroup { {% if host.value.primary_ip %} {% for tag in host.value.tags %} {% if tag.slug == "nagios" %} +# {{ host }} define host { use ansible-linux-server host_name {{ host.value.name }} alias {{ host.value.display }} address {{ host.value.primary_ip.address.split('/',1)[0] }} - hostgroups ansible{% for tag in host.value.tags %},tag-{{ tag.slug }}{% endfor %} + hostgroups ansible{% for tag in host.value.tags %},tag-{{ tag.slug }}{% endfor %}{% if host.value.device_role is defined -%},role-{{ host.value.device_role.slug }}{% endif %}{% if host.value.role is defined %},role-{{ host.value.role.slug }}{% endif %} } {% if host.value.config_context.extra_checks is defined %}