aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/linode-dns-update
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/linode-dns-update')
-rw-r--r--ansible/roles/linode-dns-update/templates/linode-dns-update.j23
1 files changed, 2 insertions, 1 deletions
diff --git a/ansible/roles/linode-dns-update/templates/linode-dns-update.j2 b/ansible/roles/linode-dns-update/templates/linode-dns-update.j2
index 97ab7c9..975c061 100644
--- a/ansible/roles/linode-dns-update/templates/linode-dns-update.j2
+++ b/ansible/roles/linode-dns-update/templates/linode-dns-update.j2
@@ -35,11 +35,12 @@ domain_resource_update "$DOMAIN_ID" "{{ linode_dns__ipv4_resource }}" "A" "[remo
{% if linode_dns__ipv6_resource is defined %}
q=''
#q='map(select(.ifname=="wlx00e01d0808b2"))'
-q='map(.addr_info) | flatten | map(select(.scope=="global" and .deprecated != true and .mngtmpaddr != true) | .local) | first'
+q='map(.addr_info) | flatten | map(select(.scope=="global" and .deprecated != true and .mngtmpaddr != true and (.local|test("^fd")|not)) | .local) | first'
ip=$(ip -6 -json addr | jq -r -c "$q")
if [[ ! -z $ip ]]
then
+ echo "Setting IPv6 to $ip."
domain_resource_update "$DOMAIN_ID" "{{ linode_dns__ipv6_resource }}" "AAAA" "$ip"
fi
{% endif %}