From 2a81d35f4a31e7c763800d63ee642da91b54a94e Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Mon, 9 Oct 2017 19:56:15 +0000 Subject: [PATCH] and a hack to get nagios working --- inventory/host_vars/download-rdu01.fedoraproject.org | 1 + inventory/host_vars/proxy13.fedoraproject.org | 2 ++ inventory/host_vars/virthost-rdu01.fedoraproject.org | 1 + .../nagios_server/templates/nagios/hosts/rdu-hosts.cfg.j2 | 8 ++------ 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/inventory/host_vars/download-rdu01.fedoraproject.org b/inventory/host_vars/download-rdu01.fedoraproject.org index 9a497c0536..bcd230f6c8 100644 --- a/inventory/host_vars/download-rdu01.fedoraproject.org +++ b/inventory/host_vars/download-rdu01.fedoraproject.org @@ -12,3 +12,4 @@ eth0_nm: 255.255.255.0 eth1_ip: 172.31.1.1 eth1_nm: 255.255.255.0 +public_ip: 204.85.14.4 diff --git a/inventory/host_vars/proxy13.fedoraproject.org b/inventory/host_vars/proxy13.fedoraproject.org index 1f282eb673..1f9b25fb56 100644 --- a/inventory/host_vars/proxy13.fedoraproject.org +++ b/inventory/host_vars/proxy13.fedoraproject.org @@ -14,6 +14,8 @@ volgroup: /dev/vg_guests eth0_ip: 172.31.2.22 eth0_nm: 255.255.255.0 +public_ip: 204.85.14.3 + # This is consumed by the roles/fedora-web/main role sponsor: redhat datacenter: rdu diff --git a/inventory/host_vars/virthost-rdu01.fedoraproject.org b/inventory/host_vars/virthost-rdu01.fedoraproject.org index 3120343c39..7421895a41 100644 --- a/inventory/host_vars/virthost-rdu01.fedoraproject.org +++ b/inventory/host_vars/virthost-rdu01.fedoraproject.org @@ -10,3 +10,4 @@ br0_ip: 172.31.2.11 br0_nm: 255.255.255.0 vpn: true +public_ip: 204.85.14.11 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 4f18f7712b..97a1e1daa1 100644 --- a/roles/nagios_server/templates/nagios/hosts/rdu-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/rdu-hosts.cfg.j2 @@ -13,12 +13,8 @@ define host { {% else %} alias {{ host }} {% endif %} -{% if hostvars[host].eth0_ip is defined %} - address {{ hostvars[host].eth0_ip }} -{% elif hostvars[host].ansible_default_ipv4 is defined %} -{% if hostvars[host].ansible_default_ipv4.address is defined %} - address {{ hostvars[host].ansible_default_ipv4.address }} -{% endif %} +{% if hostvars[host].public_ip is defined %} + address {{ hostvars[host].public_ip }} {% else %} address {{ host }} {% endif %}