From af333f0ec23a9784756a8b0e53a9896d7f61525f Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Mon, 1 Apr 2019 12:34:26 +0200 Subject: space_server: vars: rework local_hosts ..to get rid of the need for ipv4/ipv6 filters and python-netaddr dependency. --- roles/space_server/templates/s.zone.j2 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'roles/space_server/templates/s.zone.j2') diff --git a/roles/space_server/templates/s.zone.j2 b/roles/space_server/templates/s.zone.j2 index 6bf9718..a392f3d 100644 --- a/roles/space_server/templates/s.zone.j2 +++ b/roles/space_server/templates/s.zone.j2 @@ -9,13 +9,17 @@ labitrack.s. 600 IN AAAA 2a01:4262:1ab::cafe track.s. 600 IN A 185.38.175.70 track.s. 600 IN AAAA 2a01:4262:1ab::cafe {% for host in local_hosts %} +{% if 'ipv4' in host or 'ipv6' in host %} -{% if 'ips' in host and host.ips|length > 0 %} -{% for ip in host.ips|ipv4 %} +{% if 'ipv4' in host %} +{% for ip in host.ipv4 %} {{ host.name }}.s. 600 IN A {{ ip }} {% endfor %} -{% for ip in host.ips|ipv6 %} +{% endif %} +{% if 'ipv6' in host %} +{% for ip in host.ipv6 %} {{ host.name }}.s. 600 IN AAAA {{ ip }} {% endfor %} {% endif %} +{% endif %} {% endfor %} -- cgit v1.2.1