nagios: do not rely on ansible_hostname defined for the ipv6 checks
Changing the `host_name` - it was a "fake" non-DNS address anyway Specify aliases only if ansible_hostname is stated in cached facts, see https://pagure.io/fedora-infrastructure/issue/11264
This commit is contained in:
parent
33ccc11860
commit
5adeb88890
1 changed files with 6 additions and 4 deletions
|
@ -1,12 +1,15 @@
|
|||
## This template currently only works for noc02. If noc01 gets ipv6 then
|
||||
## it will need to be revisited.
|
||||
|
||||
{% for host in groups['all']|sort %}
|
||||
{% if hostvars[host].datacenter == 'ibiblio' and hostvars[host].nagios_Can_Connect == true %}
|
||||
{% for host in groups['all']|sort if
|
||||
hostvars[host].datacenter == 'ibiblio' and
|
||||
hostvars[host].nagios_Can_Connect == true
|
||||
%}
|
||||
define host {
|
||||
use mincheck6
|
||||
host_name {{ hostvars[host].ansible_hostname }}-ipv6.fedoraproject.org
|
||||
host_name ipv6-{{ host }}
|
||||
{% if hostvars[host].ansible_hostname is defined %}
|
||||
alias {{ hostvars[host].ansible_hostname }}-ipv6.fedoraproject.org
|
||||
alias {{ hostvars[host].ansible_hostname }}-ipv6
|
||||
{% else %}
|
||||
alias {{ host }}
|
||||
|
@ -26,5 +29,4 @@ define host {
|
|||
parents ibiblio-gw
|
||||
{% endif %}
|
||||
}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue