mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-05-16 13:56:03 +08:00
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:
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user