From fd67776babf81d6994e24e6baac5f79e7e83e41c Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Sat, 6 Jun 2020 16:53:30 -0400 Subject: [PATCH] Revert "have to add group by group to see where break is" This reverts commit 553341ca7a28dcfdfa3eaa3ddffc8bb0feb60a0b. --- .../templates/nagios/hostgroups/all.cfg.j2 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 b/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 index fbd4b86fdb..cd42e1da82 100644 --- a/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 @@ -2,6 +2,16 @@ # All Servers and associated devices ############### ## {{ env }} +{% for key, value in groups.iteritems()|sort %} +{% if groups[key] != [] and key not in vars['exclude_hostgroups'] %} +define hostgroup{ + hostgroup_name {{ key }} + alias {{ key }} + members {% for host in groups[key]|sort %}{% if hostvars[host].nagios_Can_Connect == true %}{{host}}, {% endif %}{% endfor %} + +} +{% endif %} +{% endfor %} define hostgroup{ hostgroup_name no_ping