nsd/templates/primary_zone_config.j2

24 lines
672 B
Plaintext
Raw Normal View History

# Primary zone definition for {{ item.zone_name }}
2016-03-26 18:20:38 +01:00
{% for slave in item.slaves %}
{% if slave.tsig_secret is defined %}
key:
name: "{{ item.zone_name }}_{{ slave.ip }}"
algorithm: "{{ slave.tsig_algorithm }}"
secret: "{{ slave.tsig_secret }}"
{% endif %}
{% endfor %}
{%- macro tsigkey(slave) %}
{% if slave.tsig_secret is defined %}{{ item.zone_name }}_{{ slave.ip }}{% else %}NOKEY{% endif %}
{% endmacro -%}
zone:
name: "{{ item.zone_name }}"
zonefile: "{{ primary_zones_dir }}/{{ item.zone_filename }}"
{% for slave in item.slaves %}
2016-03-26 18:20:38 +01:00
notify: {{ slave.ip }} "{{ tsigkey(slave) }}"
provide-xfr: {{ slave.ip }} "{{ tsigkey(slave) }}"
{% endfor %}