Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 1 | |
| 2 | {# |
| 3 | Copyright 2017-present Open Networking Foundation |
| 4 | |
| 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | you may not use this file except in compliance with the License. |
| 7 | You may obtain a copy of the License at |
| 8 | |
| 9 | http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | Unless required by applicable law or agreed to in writing, software |
| 12 | distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | See the License for the specific language governing permissions and |
| 15 | limitations under the License. |
| 16 | #} |
| 17 | |
| 18 | |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 19 | ;## NSD authoritative only DNS |
| 20 | ;## FORWARD Zone |
Zack Williams | ba5549c | 2017-03-25 15:04:45 -0700 | [diff] [blame] | 21 | ;# created by ansible |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 22 | |
| 23 | $ORIGIN {{ item.name }}. ; default zone domain |
| 24 | $TTL {{ item.ttl | default(dns_ttl) }} ; default time to live |
| 25 | |
| 26 | @ IN SOA {{ item.soa }}.{{ item.name }}. admin.{{ item.name }}. ( |
| 27 | {{ item.serial | default(ansible_date_time.epoch) }} ; Serial, must be incremented every time you change this file |
| 28 | 3600 ; Refresh [1hr] |
| 29 | 600 ; Retry [10m] |
| 30 | 3600 ; Expire [1hr] |
| 31 | 60 ; Min TTL [1m] |
| 32 | ) |
Zack Williams | 961d369 | 2016-05-01 09:24:30 -0700 | [diff] [blame] | 33 | |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 34 | ; Name Servers |
| 35 | {% for ns in item.ns %} |
| 36 | IN NS {{ ns.name ~ '.' ~ item.name }}. |
| 37 | {% endfor %} |
| 38 | |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 39 | ;A and CNAME records |
Zack Williams | 961d369 | 2016-05-01 09:24:30 -0700 | [diff] [blame] | 40 | {% if name_on_public_interface is defined %} |
| 41 | {{ name_on_public_interface }} IN A {{ ansible_default_ipv4.address }} |
| 42 | {% endif %} |
| 43 | {% if item.aliases is defined %} |
| 44 | {% for alias in item.aliases %} |
| 45 | {{ alias.name }} IN CNAME {{ alias.dest }} |
| 46 | {% endfor %} |
| 47 | {% endif %} |
| 48 | |
Zack Williams | ba5549c | 2017-03-25 15:04:45 -0700 | [diff] [blame] | 49 | {% for nodelist in item.nodelists %} |
| 50 | ; Created from nodelist: {{ nodelist }} |
| 51 | {% set nodes = vars[nodelist] %} |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 52 | {% for node in nodes %} |
| 53 | {{ node.name }} IN A {{ item.ipv4_first_octets ~ "." ~ node.ipv4_last_octet }} |
| 54 | {% if node.aliases is defined %} |
| 55 | {% for alias in node.aliases %} |
| 56 | {{ alias }} IN CNAME {{ node.name }} |
| 57 | {% endfor %} |
| 58 | {% endif %} |
| 59 | {% endfor %} |
Zack Williams | ba5549c | 2017-03-25 15:04:45 -0700 | [diff] [blame] | 60 | {% endfor %} |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 61 | |