From bbe354f7fef60671f11f7afb25b3b0cd72f4b568 Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Tue, 10 Jan 2017 17:44:33 +0000 Subject: [PATCH] debug step 02 --- roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 b/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 index 73f0323e5e..c0f625a8b8 100644 --- a/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 @@ -9,7 +9,7 @@ define hostgroup{ hostgroup_name {{ key }} alias {{ key }} - members {% for host in groups[key] %}{% if hostvars[host].env == 'staging' %}{{host}}, {% endif %}{% endfor %} + members {% for host in groups[key] %}{% if (hostvars[host].env is defined) and (hostvars[host].env == 'staging') %} {{host}}, {% endif %} {% endfor %} }