move the dns_external check to using a group variable in the nagios group. This takes it out of the main inventory where its names do not match and this other group was not used in any other playbook

This commit is contained in:
Stephen Smoogen 2020-07-01 17:40:02 -04:00
parent 4857a1f032
commit 28ba173acb
3 changed files with 8 additions and 7 deletions

View file

@ -105,6 +105,13 @@ iad2_external:
- retrace01.fedoraproject.org - retrace01.fedoraproject.org
- secondary01.fedoraproject.org - secondary01.fedoraproject.org
dns_external:
- ns-iad01.fedoraproject.org
- ns-iad02.fedoraproject.org
- ns02.fedoraproject.org
- ns05.fedoraproject.org
# When you have a group which comes up with empty members in all.cfg, it # When you have a group which comes up with empty members in all.cfg, it
# is because it contains all hosts which aren't pinganble. You may want # is because it contains all hosts which aren't pinganble. You may want
# to add that group to this list. Other items on this list are ones # to add that group to this list. Other items on this list are ones

View file

@ -392,12 +392,6 @@ ns02.fedoraproject.org
ns05.fedoraproject.org ns05.fedoraproject.org
ns13.rdu2.fedoraproject.org ns13.rdu2.fedoraproject.org
[dns_external]
ns-iad01.iad2.fedoraproject.org
ns-iad02.iad2.fedoraproject.org
ns02.fedoraproject.org
ns05.fedoraproject.org
[odcs_frontend] [odcs_frontend]
odcs-frontend01.iad2.fedoraproject.org odcs-frontend01.iad2.fedoraproject.org

View file

@ -1,7 +1,7 @@
define hostgroup { define hostgroup {
hostgroup_name dns hostgroup_name dns
alias DNS Servers alias DNS Servers
members {% for host in groups["dns_external"]|sort %} {{ hostvars[host]["inventory_hostname_short"] }}.fedoraproject.org {% if not loop.last %}, {% endif %} {% endfor %} members {% for host in vars['dns_external']|sort %}{{ host }}{% if not loop.last %}, {% endif %} {% endfor %}
} }