ansible-role-bind/templates/db.j2

35 lines
1.4 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 %}
2018-10-07 10:57:36 +00:00
{% if item.key in bind_dnssec %}
2017-10-08 12:55:01 +00:00
2020-02-12 21:01:02 +00:00
{% for key_type, key_values in bind_dnssec[item.key].items() %}
2018-10-07 10:57:36 +00:00
$INCLUDE K{{ item.key }}.+{{ "00{}".format(key_values.algorithm)[-3:] }}+{{ key_values.tag }}.key
{% endfor %}
2017-10-08 12:55:01 +00:00
{% endif %}