nsd/templates/zones_config.j2
Baptiste Jonglez eef721d276 NSD: Simplify configuration to use only one file for all zones, instead of many includes
This also allows the playbook to be idempotent.
2017-09-01 10:20:48 +02:00

45 lines
1.3 KiB
Django/Jinja

# NSD configuration, automatically generated by Ansible.
# Do not edit by hand!
#
# This file is included by the main configuration file, and contains
# definitions for all zones (primary and secondary) and TSIG keys.
## TSIG keys ##
{% for key in nsd_tsig_keys|default([]) %}
key:
name: "{{ key.tsig_keyname }}"
secret: "{{ key.tsig_secret }}"
algorithm: "{{ key.tsig_algorithm }}"
{% endfor %}
## Primary zones ##
{% for zone in nsd_primary_zones|default([]) %}
# Primary zone definition for {{ zone.zone_name }}
zone:
name: "{{ zone.zone_name }}"
zonefile: "{{ primary_zones_dir }}/{{ zone.zone_filename }}"
{% for slave in zone.slaves|default([]) %}
notify: {{ slave.ip }} "{{ slave.tsig_key|default('NOKEY') }}"
provide-xfr: {{ slave.ip }} "{{ slave.tsig_key|default('NOKEY') }}"
{% endfor %}
{% endfor %}
## Secondary zones ##
{% for zone in nsd_secondary_zones|default([]) %}
# Secondary zone definition for {{ zone.zone_name }}
zone:
name: "{{ zone.zone_name }}"
zonefile: "{{ secondary_zones_dir }}/{{ zone.zone_name }}"
{% for master in zone.masters|default([]) %}
allow-notify: {{ master.ip }} "{{ master.tsig_key|default('NOKEY') }}"
request-xfr: AXFR {{ master.ip }} "{{ master.tsig_key|default('NOKEY') }}"
{% endfor %}
{% endfor %}