This repository has been archived on 2020-08-18. You can view files and clone it, but cannot push or open issues or pull requests.
ansible-dns/templates/redxen-dns.conf.j2

35 lines
1.5 KiB
Django/Jinja

server:
local-zone: "redxen.eu." static
{% for host in groups['all'] %}
local-data: "redxen.eu. 10800 IN NS {{ host }}.redxen.eu"
{% endfor %}
local-data: "redxen.eu. IN SOA n0.redxen.eu admin.redxen.eu 2020053102 1800 120 604800 3600"
{% for record in unbound.public.TXT %}
local-data: '{{ record.name }}redxen.eu. 86400 IN TXT "{{ record.content }}" {% if record.content2|default(false) %}"{{ record.content2 }}"{% endif %}'
{% endfor %}
{% for record in unbound.public.CNAME %}
local-data: "{{ record.name }}redxen.eu. 86400 IN CNAME {{ record.pointer }}"
{% endfor %}
{% for record in unbound.public.SRV %}
local-data: "_{{ record.service }}._{{ record.proto }}.redxen.eu. 86400 IN SRV 0 5 {{ record.port }} {{ record.host }}."
{% endfor %}
{% for record in unbound.public.MX %}
local-data: "{{ record.name }}redxen.eu. 86400 IN MX {{ record.priority|default(10) }} {{ record.host }}"
{% endfor %}
{% for domains in unbound.public.group.A %}
{% for host in groups[domains.group] %}
local-data: "{{ domains.domain }}redxen.eu. 86400 IN A {{ hostvars[host]['ansible_default_ipv4']['address'] }}"
local-data: "{{ domains.domain }}redxen.eu. 86400 IN AAAA {{ hostvars[host]['ansible_default_ipv6']['address'] }}"
{% endfor %}
{% endfor %}
{% for host in groups['all'] %}
local-data: "{{ host }}.redxen.eu. 86400 IN A {{ hostvars[host]['ansible_default_ipv4']['address'] }}"
local-data: "{{ host }}.redxen.eu. 86400 IN AAAA {{ hostvars[host]['ansible_default_ipv6']['address'] }}"
{% endfor %}