ansible-role-bind/templates/db.j2

31 lines
1.1 KiB
Django/Jinja

; {{ ansible_managed }}
$TTL {{ item.value.ttl|default(3600) }}
@ IN SOA {{ item.value.ns_primary }}. {{ item.value.mail|replace('@', '.') }}. (
{{ item.value.serial }} ; Serial
{{ item.value.refresh|default(14400) }} ; Refresh
{{ item.value.retry|default(86400) }} ; Retry
{{ item.value.expire|default(2419200) }} ; Expire
{{ item.value.negative_cache|default(86400) }} ; Negative Cache TTL
)
{% for entry in item.value.entries %}
{% if entry.type|upper == 'MX' %}
{{ entry.name }} {{ entry.ttl|default(' ') }} IN MX {{ entry.priority }} {{ entry.value }}
{% elif entry.type|upper == 'CAA' %}
{{ entry.name }} {{ entry.ttl|default(' ') }} CAA {{ entry.flag }} {{ entry.tag }} "{{ entry.value }}"
{% elif entry.type|upper == 'TXT' %}
{{ entry.name }} {{ entry.ttl|default(' ') }} IN TXT (
{% for charset in entry.value|batch(64) %}
"{{ charset|join('') }}"
{% endfor %}
)
{% else %}
{{ entry.name }} {{ entry.ttl|default(' ') }} IN {{ entry.type|upper }} {{ entry.value }}
{% endif %}
{% endfor %}
{% if 'dnssec' in item.value and item.value.dnssec %}
$INCLUDE {{ item.key }}.key
$INCLUDE {{ item.key }}-ksk.key
{% endif %}