| ;## NSD authoritative only DNS |
| $ORIGIN {{ item.name }}. ; default zone domain |
| $TTL {{ item.ttl | default(dns_ttl) }} ; default time to live |
| @ IN SOA {{ item.soa }}.{{ item.name }}. admin.{{ item.name }}. ( |
| {{ item.serial | default(ansible_date_time.epoch) }} ; Serial, must be incremented every time you change this file |
| IN NS {{ ns.name ~ '.' ~ item.name }}. |
| {% if name_on_public_interface is defined %} |
| {{ name_on_public_interface }} IN A {{ ansible_default_ipv4.address }} |
| {% if item.aliases is defined %} |
| {% for alias in item.aliases %} |
| {{ alias.name }} IN CNAME {{ alias.dest }} |
| {% set nodes = vars[item.nodelist] %} |
| {{ node.name }} IN A {{ item.ipv4_first_octets ~ "." ~ node.ipv4_last_octet }} |
| {% if node.aliases is defined %} |
| {% for alias in node.aliases %} |
| {{ alias }} IN CNAME {{ node.name }} |