blob: 86eae0c1822ffb1d62d7f9450c141b7d6c81caaa [file] [log] [blame]
Matteo Scandolo3896c472017-08-01 13:31:42 -07001{#
2Copyright 2017-present Open Networking Foundation
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15#}
16
Zack Williams99adf6b2016-03-14 17:01:08 -070017;## NSD authoritative only DNS
18;## FORWARD Zone
Zack Williams6dc2d452017-12-20 17:50:49 -070019;# created by dns-nsd/templates/zone.forward.j2
Zack Williams99adf6b2016-03-14 17:01:08 -070020
21$ORIGIN {{ item.name }}. ; default zone domain
22$TTL {{ item.ttl | default(dns_ttl) }} ; default time to live
23
24@ IN SOA {{ item.soa }}.{{ item.name }}. admin.{{ item.name }}. (
25 {{ item.serial | default(ansible_date_time.epoch) }} ; Serial, must be incremented every time you change this file
26 3600 ; Refresh [1hr]
27 600 ; Retry [10m]
28 3600 ; Expire [1hr]
29 60 ; Min TTL [1m]
30 )
Zack Williams961d3692016-05-01 09:24:30 -070031
Zack Williams99adf6b2016-03-14 17:01:08 -070032; Name Servers
33{% for ns in item.ns %}
34 IN NS {{ ns.name ~ '.' ~ item.name }}.
35{% endfor %}
36
Zack Williams99adf6b2016-03-14 17:01:08 -070037;A and CNAME records
Zack Williams961d3692016-05-01 09:24:30 -070038{% if item.aliases is defined %}
39{% for alias in item.aliases %}
40{{ alias.name }} IN CNAME {{ alias.dest }}
41{% endfor %}
42{% endif %}
43
Zack Williamsba5549c2017-03-25 15:04:45 -070044{% for nodelist in item.nodelists %}
45; Created from nodelist: {{ nodelist }}
46{% set nodes = vars[nodelist] %}
Zack Williams99adf6b2016-03-14 17:01:08 -070047{% for node in nodes %}
Zack Williams6dc2d452017-12-20 17:50:49 -070048{{ node.name }} IN A {{ item.cidr | ipaddr(node.ipv4_last_octet) | ipaddr('address') }}
Zack Williams99adf6b2016-03-14 17:01:08 -070049{% if node.aliases is defined %}
50{% for alias in node.aliases %}
51{{ alias }} IN CNAME {{ node.name }}
52{% endfor %}
53{% endif %}
54{% endfor %}
Zack Williamsba5549c2017-03-25 15:04:45 -070055{% endfor %}
Zack Williams99adf6b2016-03-14 17:01:08 -070056