Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 1 | ;## NSD authoritative only DNS |
| 2 | ;## FORWARD Zone |
Zack Williams | ba5549c | 2017-03-25 15:04:45 -0700 | [diff] [blame] | 3 | ;# created by ansible |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 4 | |
| 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 Williams | 961d369 | 2016-05-01 09:24:30 -0700 | [diff] [blame] | 15 | |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 16 | ; Name Servers |
| 17 | {% for ns in item.ns %} |
| 18 | IN NS {{ ns.name ~ '.' ~ item.name }}. |
| 19 | {% endfor %} |
| 20 | |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 21 | ;A and CNAME records |
Zack Williams | 961d369 | 2016-05-01 09:24:30 -0700 | [diff] [blame] | 22 | {% 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 Williams | ba5549c | 2017-03-25 15:04:45 -0700 | [diff] [blame] | 31 | {% for nodelist in item.nodelists %} |
| 32 | ; Created from nodelist: {{ nodelist }} |
| 33 | {% set nodes = vars[nodelist] %} |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 34 | {% 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 Williams | ba5549c | 2017-03-25 15:04:45 -0700 | [diff] [blame] | 42 | {% endfor %} |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 43 | |