full-dns/templates/main_zone.conf.j2

25 lines
931 B
Plaintext
Raw Normal View History

2020-08-03 19:25:51 +02:00
$ORIGIN {{ main_zone.name }}.
$TTL {{ main_zone.ttl|default(3600) }}
{{ main_zone.name }}. SOA {{ main_zone.soa }}. {{ main_zone.email }}. (
{{ ansible_date_time.epoch }} ; serial
3600 ; refresh
900 ; retry
1209600 ; expire
1800 ; ttl
)
NS {{ server.hostname }}.
{% for satellite in satellites %}
NS {{ satellite.hostname }}.
{% endfor %}
{% for record in main_zone.records|default([])|json_query('[?type==`MX`]') %}
MX{% if record.opts is defined %} {{ record.opts }}{% endif %} {{ record.value }}
{% endfor %}
{{ server.hostname }}. IN A {{ server.public_ip }}
{% for satellite in satellites %}
{{ satellite.hostname }}. IN A {{ satellite.public_ip }}
{% endfor %}
{% for record in main_zone.records|default([])|json_query('[?type!=`MX`]') %}
{{ record.name }} IN {{ record.type }}{% if record.opts is defined %} {{ record.opts }}{% endif %} {{ record.value }}
{% endfor %}