diff --git a/roles/nagios/templates/nagios-ansible-inventory.cfg.j2 b/roles/nagios/templates/nagios-ansible-inventory.cfg.j2 index 824c21f..52bc7bd 100644 --- a/roles/nagios/templates/nagios-ansible-inventory.cfg.j2 +++ b/roles/nagios/templates/nagios-ansible-inventory.cfg.j2 @@ -139,6 +139,7 @@ define hostgroup { # Inventory Hosts and related services {% for host in groups['tags_nagios'] %} {% set vars = hostvars[host] %} +{% if vars.tags is defined %} define host { use ansible-linux-server host_name {{ host }} @@ -213,4 +214,5 @@ define service { {# #} {% endfor %} {% endfor %} +{% endif %} {% endfor %}