This repository has been archived on 2020-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
ansible-nsd/templates/redxen.eu.zone.j2

37 lines
1.1 KiB
Django/Jinja

$ORIGIN redxen.eu.
$TTL 1800
@ IN SOA n0.redxen.eu. admin.redxen.eu. (
2020053101
30m
2m
1w
1h
)
{% for host in groups['dns'] %}
@ NS {{ host }}
{% endfor %}
{% for host in groups['all'] %}
{{ host }} A {{ hostvars[host]['ansible_default_ipv4']['address'] }}
{{ host }} AAAA {{ hostvars[host]['ansible_default_ipv6']['address'] }}
{% endfor %}
{% for domains in unbound.public.group.A %}
{% for host in groups[domains.group] %}
{{ domains.domain|default("@") }} A {{ hostvars[host]['ansible_default_ipv4']['address'] }}
{{ domains.domain|default("@") }} AAAA {{ hostvars[host]['ansible_default_ipv6']['address'] }}
{% endfor %}
{% endfor %}
{% for record in unbound.public.TXT %}
{{ record.name|default("@") }} TXT {{ record.content }}
{% endfor %}
{% for record in unbound.public.CNAME %}
{{ record.name|default("@") }} CNAME {{ record.pointer }}
{% endfor %}
{% for record in unbound.public.SRV %}
_{{ record.service }}._{{ record.proto }} SRV 0 5 {{ record.port }} {{ record.host }}.
{% endfor %}
{% for record in unbound.public.A %}
{{ record.name|default("@") }} A {{ record.addr }}
{% endfor %}