blob: 895d8a3471a39640f29c0b703dbcfe7d2d931f05 [file] [log] [blame]
Zack Williams99adf6b2016-03-14 17:01:08 -07001;## NSD authoritative only DNS
2;## FORWARD Zone
3
4$ORIGIN {{ item.name }}. ; default zone domain
5$TTL {{ item.ttl | default(dns_ttl) }} ; default time to live
6
7@ IN SOA {{ item.soa }}.{{ item.name }}. admin.{{ item.name }}. (
8 {{ item.serial | default(ansible_date_time.epoch) }} ; Serial, must be incremented every time you change this file
9 3600 ; Refresh [1hr]
10 600 ; Retry [10m]
11 3600 ; Expire [1hr]
12 60 ; Min TTL [1m]
13 )
Zack Williams961d3692016-05-01 09:24:30 -070014
Zack Williams99adf6b2016-03-14 17:01:08 -070015; Name Servers
16{% for ns in item.ns %}
17 IN NS {{ ns.name ~ '.' ~ item.name }}.
18{% endfor %}
19
Zack Williams99adf6b2016-03-14 17:01:08 -070020;A and CNAME records
Zack Williams961d3692016-05-01 09:24:30 -070021{% if name_on_public_interface is defined %}
22{{ name_on_public_interface }} IN A {{ ansible_default_ipv4.address }}
23{% endif %}
24{% if item.aliases is defined %}
25{% for alias in item.aliases %}
26{{ alias.name }} IN CNAME {{ alias.dest }}
27{% endfor %}
28{% endif %}
29
30; Set from list of nodes
31{% set nodes = vars[item.nodelist] %}
Zack Williams99adf6b2016-03-14 17:01:08 -070032{% for node in nodes %}
33{{ node.name }} IN A {{ item.ipv4_first_octets ~ "." ~ node.ipv4_last_octet }}
34{% if node.aliases is defined %}
35{% for alias in node.aliases %}
36{{ alias }} IN CNAME {{ node.name }}
37{% endfor %}
38{% endif %}
39{% endfor %}
40