ansible-role-bind/templates/db.j2

34 lines
1.3 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
)
2018-03-17 10:07:20 +00:00
{% for record in item.value.records %}
{% if record.type|upper == 'MX' %}
{{ record.name }} {{ record.ttl|default(' ') }} IN MX {{ record.priority }} {{ record.value }}
2018-05-25 11:06:21 +00:00
{% elif record.type|upper == 'SRV' %}
{{ record.name }} {{ record.ttl|default(' ') }} IN SRV {{ record.priority }} {{ record.weight }} {{ record.port }} {{ record.value }}
2018-03-17 10:07:20 +00:00
{% elif record.type|upper == 'CAA' %}
{{ record.name }} {{ record.ttl|default(' ') }} CAA {{ record.flag }} {{ record.tag }} "{{ record.value }}"
{% elif record.type|upper == 'TXT' %}
{{ record.name }} {{ record.ttl|default(' ') }} IN TXT (
{% for charset in record.value|batch(64) %}
2017-10-15 07:03:46 +00:00
"{{ charset|join('') }}"
{% endfor %}
)
2017-10-08 12:55:01 +00:00
{% else %}
2018-03-17 10:07:20 +00:00
{{ record.name }} {{ record.ttl|default(' ') }} IN {{ record.type|upper }} {{ record.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 %}