diff --git a/roles/nagios_server/templates/nagios/hosts/aws-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/aws-hosts.cfg.j2 index 9b56238f0b..9db8882cc6 100644 --- a/roles/nagios_server/templates/nagios/hosts/aws-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/aws-hosts.cfg.j2 @@ -1,5 +1,5 @@ -{% for host in groups['all']|sort %} -{% if hostvars[host].datacenter == 'ec2' and hostvars[host].nagios_Check_Services['ping'] == true %} +{% for host in groups['ec2']|sort %} +{% if hostvars[host].nagios_Check_Services['ping'] %} define host { {% if vars['nagios_location'] == 'internal' %} use defaulttemplate