nsd/templates/zones_config.j2
Baptiste Jonglez 4b6015abfc Use defaults/main.yml to avoid checking for empty lists everywhere
This fixes one task that was failing when no primary zone was defined (the
task copying zone files)
2017-09-01 22:39:51 +02:00

45 lines
1.2 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 %}
key:
name: "{{ key.tsig_keyname }}"
secret: "{{ key.tsig_secret }}"
algorithm: "{{ key.tsig_algorithm }}"
{% endfor %}
## Primary zones ##
{% for zone in nsd_primary_zones %}
# Primary zone definition for {{ zone.zone_name }}
zone:
name: "{{ zone.zone_name }}"
zonefile: "{{ nsd_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 %}
# Secondary zone definition for {{ zone.zone_name }}
zone:
name: "{{ zone.zone_name }}"
zonefile: "{{ nsd_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 %}