blob: 129fa7c235fe1e86309efdd6a59d7cabac831674 [file] [log] [blame]
Zack Williams99adf6b2016-03-14 17:01:08 -07001;## NSD authoritative only DNS
2;## FORWARD Zone
Zack Williamsba5549c2017-03-25 15:04:45 -07003;# created by ansible
Zack Williams99adf6b2016-03-14 17:01:08 -07004
5$ORIGIN {{ item.name }}. ; default zone domain
6$TTL {{ item.ttl | default(dns_ttl) }} ; default time to live
7
8@ IN SOA {{ item.soa }}.{{ item.name }}. admin.{{ item.name }}. (
9 {{ item.serial | default(ansible_date_time.epoch) }} ; Serial, must be incremented every time you change this file
10 3600 ; Refresh [1hr]
11 600 ; Retry [10m]
12 3600 ; Expire [1hr]
13 60 ; Min TTL [1m]
14 )
Zack Williams961d3692016-05-01 09:24:30 -070015
Zack Williams99adf6b2016-03-14 17:01:08 -070016; Name Servers
17{% for ns in item.ns %}
18 IN NS {{ ns.name ~ '.' ~ item.name }}.
19{% endfor %}
20
Zack Williams99adf6b2016-03-14 17:01:08 -070021;A and CNAME records
Zack Williams961d3692016-05-01 09:24:30 -070022{% if name_on_public_interface is defined %}
23{{ name_on_public_interface }} IN A {{ ansible_default_ipv4.address }}
24{% endif %}
25{% if item.aliases is defined %}
26{% for alias in item.aliases %}
27{{ alias.name }} IN CNAME {{ alias.dest }}
28{% endfor %}
29{% endif %}
30
Zack Williamsba5549c2017-03-25 15:04:45 -070031{% for nodelist in item.nodelists %}
32; Created from nodelist: {{ nodelist }}
33{% set nodes = vars[nodelist] %}
Zack Williams99adf6b2016-03-14 17:01:08 -070034{% for node in nodes %}
35{{ node.name }} IN A {{ item.ipv4_first_octets ~ "." ~ node.ipv4_last_octet }}
36{% if node.aliases is defined %}
37{% for alias in node.aliases %}
38{{ alias }} IN CNAME {{ node.name }}
39{% endfor %}
40{% endif %}
41{% endfor %}
Zack Williamsba5549c2017-03-25 15:04:45 -070042{% endfor %}
Zack Williams99adf6b2016-03-14 17:01:08 -070043