diff --git a/roles/nagios_server/templates/nagios/hosts/bodhost-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/bodhost-hosts.cfg.j2 index b8e0e34f34..ed5e79bf64 100644 --- a/roles/nagios_server/templates/nagios/hosts/bodhost-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/bodhost-hosts.cfg.j2 @@ -1,4 +1,4 @@ -{% for host in groups['all'] %} +{% for host in groups['all']|sort %} {% if hostvars[host].datacenter == 'bodhost' and hostvars[host].nagios_Check_Services['ping'] == true %} define host { {% if vars['nagios_location'] == 'internal' %} diff --git a/roles/nagios_server/templates/nagios/hosts/cloud-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/cloud-hosts.cfg.j2 index cd13e6ed62..639ae9c70c 100644 --- a/roles/nagios_server/templates/nagios/hosts/cloud-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/cloud-hosts.cfg.j2 @@ -1,4 +1,4 @@ -{% for host in groups['cloud'] %} +{% for host in groups['cloud']|sort %} {% if host.startswith('copr') and nagios_location == 'external' %} {% else %} define host { diff --git a/roles/nagios_server/templates/nagios/hosts/coloamer-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/coloamer-hosts.cfg.j2 index 3fc1d4eac9..50a7e0c1cd 100644 --- a/roles/nagios_server/templates/nagios/hosts/coloamer-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/coloamer-hosts.cfg.j2 @@ -1,4 +1,4 @@ -{% for host in groups['all'] %} +{% for host in groups['all']|sort %} {% if hostvars[host].datacenter == 'coloamer' and hostvars[host].nagios_Check_Services['ping'] == true %} define host { {% if vars['nagios_location'] == 'internal' %} diff --git a/roles/nagios_server/templates/nagios/hosts/dedicatedsolutions-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/dedicatedsolutions-hosts.cfg.j2 index 951a4a0d69..adefe9ac52 100644 --- a/roles/nagios_server/templates/nagios/hosts/dedicatedsolutions-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/dedicatedsolutions-hosts.cfg.j2 @@ -1,4 +1,4 @@ -{% for host in groups['all'] %} +{% for host in groups['all']|sort %} {% if hostvars[host].datacenter == 'dedicatedsolutions' and hostvars[host].nagios_Check_Services['ping'] == true %} define host { {% if vars['nagios_location'] == 'internal' %} diff --git a/roles/nagios_server/templates/nagios/hosts/host1plus-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/host1plus-hosts.cfg.j2 index da88baf257..2fb41cd997 100644 --- a/roles/nagios_server/templates/nagios/hosts/host1plus-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/host1plus-hosts.cfg.j2 @@ -1,4 +1,4 @@ -{% for host in groups['all'] %} +{% for host in groups['all']|sort %} {% if hostvars[host].datacenter == 'host1plus' and hostvars[host].nagios_Check_Services['ping'] == true %} define host { {% if vars['nagios_location'] == 'internal' %} diff --git a/roles/nagios_server/templates/nagios/hosts/ibiblio-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/ibiblio-hosts.cfg.j2 index 8f4e248852..6a2d1d0ea1 100644 --- a/roles/nagios_server/templates/nagios/hosts/ibiblio-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/ibiblio-hosts.cfg.j2 @@ -1,4 +1,4 @@ -{% for host in groups['all'] %} +{% for host in groups['all']|sort %} {% if hostvars[host].datacenter == 'ibiblio' and hostvars[host].nagios_Check_Services['ping'] == true %} define host { {% if vars['nagios_location'] == 'internal' %} diff --git a/roles/nagios_server/templates/nagios/hosts/internetx-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/internetx-hosts.cfg.j2 index fc3c01d773..5ab3761e3b 100644 --- a/roles/nagios_server/templates/nagios/hosts/internetx-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/internetx-hosts.cfg.j2 @@ -1,4 +1,4 @@ -{% for host in groups['all'] %} +{% for host in groups['all']|sort %} {% if hostvars[host].datacenter == 'internetx' and hostvars[host].nagios_Check_Services['ping'] == true %} define host { {% if vars['nagios_location'] == 'internal' %} diff --git a/roles/nagios_server/templates/nagios/hosts/osuosl-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/osuosl-hosts.cfg.j2 index efba7769e9..6e2b394e5c 100644 --- a/roles/nagios_server/templates/nagios/hosts/osuosl-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/osuosl-hosts.cfg.j2 @@ -1,4 +1,4 @@ -{% for host in groups['all'] %} +{% for host in groups['all']|sort %} {% if hostvars[host].datacenter == 'osuosl' and hostvars[host].nagios_Check_Services['ping'] == true %} define host { {% if vars['nagios_location'] == 'internal' %} diff --git a/roles/nagios_server/templates/nagios/hosts/phx2-external.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/phx2-external.cfg.j2 index 9e711cedb4..2e9d458869 100644 --- a/roles/nagios_server/templates/nagios/hosts/phx2-external.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/phx2-external.cfg.j2 @@ -1,4 +1,4 @@ -{% for host in vars["phx2_external"] %} +{% for host in vars["phx2_external"]|sort %} define host { host_name {{ host }} alias {{ host }} diff --git a/roles/nagios_server/templates/nagios/hosts/phx2-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/phx2-hosts.cfg.j2 index 986614d8e7..47108e77d1 100644 --- a/roles/nagios_server/templates/nagios/hosts/phx2-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/phx2-hosts.cfg.j2 @@ -1,4 +1,4 @@ -{% for host in groups['all'] %} +{% for host in groups['all']|sort %} {% if hostvars[host].datacenter == 'phx2' and hostvars[host].nagios_Check_Services['ping'] == true %} define host { {% if hostvars[host].nagios_Check_Services['nrpe'] == true %} diff --git a/roles/nagios_server/templates/nagios/hosts/phx2-mgmt-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/phx2-mgmt-hosts.cfg.j2 index 8d10714ae7..777f9d68ab 100644 --- a/roles/nagios_server/templates/nagios/hosts/phx2-mgmt-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/phx2-mgmt-hosts.cfg.j2 @@ -1,4 +1,4 @@ -{% for host in vars['phx2_management_hosts'] %} +{% for host in vars['phx2_management_hosts']|sort %} define host { host_name {{ host }} alias {{ host }} @@ -11,7 +11,7 @@ define host { ## ## These hosts may have limited ssh/http/https -{% for host in vars['phx2_management_limited'] %} +{% for host in vars['phx2_management_limited']|sort %} define host { host_name {{ host }} alias {{ host }} diff --git a/roles/nagios_server/templates/nagios/hosts/rdu-cc-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/rdu-cc-hosts.cfg.j2 index c8cf518e89..e8bd258b6c 100644 --- a/roles/nagios_server/templates/nagios/hosts/rdu-cc-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/rdu-cc-hosts.cfg.j2 @@ -1,4 +1,4 @@ -{% for host in groups['all'] %} +{% for host in groups['all']|sort %} {% if hostvars[host].datacenter == 'rdu-cc' and hostvars[host].nagios_Check_Services['ping'] == true %} define host { {% if vars['nagios_location'] == 'internal' %} diff --git a/roles/nagios_server/templates/nagios/hosts/rdu-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/rdu-hosts.cfg.j2 index b8769d41f1..f476dc28f0 100644 --- a/roles/nagios_server/templates/nagios/hosts/rdu-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/rdu-hosts.cfg.j2 @@ -1,4 +1,4 @@ -{% for host in groups['all'] %} +{% for host in groups['all']|sort %} {% if hostvars[host].datacenter == 'rdu' and hostvars[host].nagios_Check_Services['ping'] == true %} define host { {% if vars['nagios_location'] == 'internal' %} diff --git a/roles/nagios_server/templates/nagios/hosts/staging-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/staging-hosts.cfg.j2 index 0ffb90320e..a2f3c216f0 100644 --- a/roles/nagios_server/templates/nagios/hosts/staging-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/staging-hosts.cfg.j2 @@ -1,4 +1,4 @@ -{% for host in groups['all'] %} +{% for host in groups['all']|sort %} {% if hostvars[host].datacenter == 'staging' and hostvars[host].nagios_Check_Services['ping'] == true %} define host { {% if hostvars[host].nagios_Check_Services['nrpe'] == true %} diff --git a/roles/nagios_server/templates/nagios/hosts/tummy-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/tummy-hosts.cfg.j2 index a374035b8a..6bbd737ee1 100644 --- a/roles/nagios_server/templates/nagios/hosts/tummy-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/tummy-hosts.cfg.j2 @@ -1,4 +1,4 @@ -{% for host in groups['all'] %} +{% for host in groups['all']|sort %} {% if hostvars[host].datacenter == 'tummy' and hostvars[host].nagios_Check_Services['ping'] == true %} define host { {% if vars['nagios_location'] == 'internal' %}