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/internal.conf.j2

24 lines
854 B
Django/Jinja

server:
local-zone: "redxen.localhost." static
{% for host in groups['all'] %}
local-data: "{{ host }}.redxen.localhost. 60 IN A {{ hostvars[host]['ansible_ens10']['ipv4']['address'] }}"
{% endfor %}
{% for entry in unbound.internal.local.SRV %}
{% if entry.rawhost|default(false) %}
local-data: "_{{ entry.service }}._tcp.redxen.localhost. 60 IN SRV 0 5 {{ entry.port }} {{ entry.rawhost }}."
{% else %}
{% for host in groups[entry.group] %}
local-data: "_{{ entry.service }}._tcp.redxen.localhost. 60 IN SRV 0 5 {{ entry.port }} {{ host }}.redxen.localhost."
{% endfor %}
{% endif %}
{% endfor %}
{% for entry in unbound.internal.local.A %}
{% for host in groups[entry.group] %}
local-data: "{{ entry.service }}.redxen.localhost. 60 IN A {{ hostvars[host]['ansible_ens10']['ipv4']['address'] }}"
{% endfor %}
{% endfor %}