ansible-role-bind/templates/db.j2

30 lines
1 KiB
Text
Raw Normal View History

2017-10-08 12:55:01 +00:00
; {{ ansible_managed }}
$TTL {{ item.value.ttl|default(3600) }}
@ IN SOA {{ item.value.ns_primary }}. {{ item.value.mail|replace('@', '.') }}. (
2017-10-15 07:09:02 +00:00
{{ 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
2017-10-08 12:55:01 +00:00
)
{% for entry in item.value.entries %}
{% if entry.type|upper == 'MX' %}
2018-03-16 23:36:43 +00:00
{{ entry.name }} {{ entry.ttl|default(' ') }} IN MX {{ entry.priority }} {{ entry.value }}
2017-10-15 07:03:46 +00:00
{% elif entry.type|upper == 'TXT' %}
2018-03-16 23:36:43 +00:00
{{ entry.name }} {{ entry.ttl|default(' ') }} IN {{ entry.type|upper }} (
2017-10-15 07:03:46 +00:00
{% for charset in entry.value|batch(64) %}
"{{ charset|join('') }}"
{% endfor %}
)
2017-10-08 12:55:01 +00:00
{% else %}
2018-03-16 23:36:43 +00:00
{{ entry.name }} {{ entry.ttl|default(' ') }} IN {{ entry.type|upper }} {{ entry.value }}
2017-10-08 12:55:01 +00:00
{% endif %}
{% endfor %}
{% if 'dnssec' in item.value and item.value.dnssec %}
$INCLUDE {{ item.key }}.key
$INCLUDE {{ item.key }}-ksk.key
{% endif %}