From a40e911e7b914e1663fa6558a1211381ef7a2086 Mon Sep 17 00:00:00 2001 From: Rick Elrod Date: Thu, 6 Feb 2020 19:12:00 +0000 Subject: [PATCH] Revert "just use the hostname as the address here, because aws is weird with networking" This reverts commit 7c1646d89358852faf5d6ef28c4e9232304af145. --- .../nagios_server/templates/nagios/hosts/aws-hosts.cfg.j2 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/nagios_server/templates/nagios/hosts/aws-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/aws-hosts.cfg.j2 index 7b58737675..9db8882cc6 100644 --- a/roles/nagios_server/templates/nagios/hosts/aws-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/aws-hosts.cfg.j2 @@ -13,7 +13,15 @@ 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 %} +{% else %} address {{ host }} +{% endif %} } {% endif %} {% endfor %}