aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/linode-dns-update
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2018-12-26 11:02:22 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2018-12-26 11:02:22 +0100
commit37e93cced23e0ee726309e841b1dac19e9ccdac4 (patch)
tree8c692652c0a5fdbd0d95510dabd58c95e1805541 /ansible/roles/linode-dns-update
parent72811f0f48cad07351ab5c5224616383a6920add (diff)
downloadinfra-37e93cced23e0ee726309e841b1dac19e9ccdac4.tar.gz
infra-37e93cced23e0ee726309e841b1dac19e9ccdac4.tar.bz2
infra-37e93cced23e0ee726309e841b1dac19e9ccdac4.tar.xz
infra-37e93cced23e0ee726309e841b1dac19e9ccdac4.zip
o Working borg setup.
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 %}