Only use ipv6 dns if nodepool uses ipv6

We think we have growing pains in some clouds where ipv6 is available
but we want to force the instances to use ipv4 dns anyway. We can do
this by telling nodepool to use ipv4 for the instance ip which we can
then check in our role to configure unbound.

Do this to rule out ipv6 as a problem in these clouds.

Change-Id: I354015df64032e70422231f1105807f024fe2393
This commit is contained in:
Clark Boylan 2019-05-14 15:38:22 -07:00
parent fc2401e21f
commit 7d5673f6db

View File

@ -9,11 +9,13 @@
that:
- unbound_config.stat.exists
# ansible_default_ipv6 can either be undefined (no ipv6) or blank (no
# routable address). We only want to use ipv6 if it's available &
# routable; combine these checks into this fact.
# We only want to use ipv6 if it is both the interface ip provided by nodepool
# and a valid address on the host. We check first that the interface_ip is
# defined and ipv6 then check if there is an interface that can route ipv6.
- name: Check for IPv6
when:
- hostvars[inventory_hostname]['nodepool']['interface_ip'] is defined
- hostvars[inventory_hostname]['nodepool']['interface_ip'] |ipv6
- hostvars[inventory_hostname]['ansible_default_ipv6'] is defined
- hostvars[inventory_hostname]['ansible_default_ipv6']['address'] is defined
set_fact: