From b2c93d44412a16825cec21d806e38f5e48246f3f Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Tue, 11 Jan 2022 03:03:49 +0000 Subject: Resolve inventory hostnames with dnspython when injecting to /etc/hosts --- roles/common/templates/etc-hosts.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/common/templates/etc-hosts.j2 b/roles/common/templates/etc-hosts.j2 index 141f3d1..6fdbdaa 100644 --- a/roles/common/templates/etc-hosts.j2 +++ b/roles/common/templates/etc-hosts.j2 @@ -4,4 +4,4 @@ ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters -{{ ansible_host }} {{ inventory_hostname }}.box.pydis.wtf {{ inventory_hostname }} +{{ lookup('dig', ansible_host) }} {{ inventory_hostname }}.box.pydis.wtf {{ inventory_hostname }} -- cgit v1.2.3