diff --git a/inventory/host_vars/copr-pulp.aws.fedoraproject.org b/inventory/host_vars/copr-pulp.aws.fedoraproject.org index 625415e4c4..8f130395e9 100644 --- a/inventory/host_vars/copr-pulp.aws.fedoraproject.org +++ b/inventory/host_vars/copr-pulp.aws.fedoraproject.org @@ -1,6 +1,6 @@ hostbase: copr-pulp- # This instance is WIP and we don't want nagios alerts yet -nagios_Can_Connect: false +nagios_Can_Connect: true nagios_Check_Services: dhcpd: false httpd: false diff --git a/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 b/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 index faf89a3dc0..9ab0f42d8f 100644 --- a/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 @@ -7,8 +7,10 @@ define hostgroup{ hostgroup_name {{ key }} alias {{ key }} - members {% for host in groups[key]|sort %}{% if hostvars[host].nagios_Can_Connect == true %}{{host}}, {% endif %}{% endfor %} - +{% for host in groups[key]|sort if hostvars[host].nagios_Can_Connect == true %} +{% if loop.first %} + members {{ host }}{% else %}, {{ host }}{% endif %} +{%- endfor %} } {% endif %} {% endfor %}