2016-03-26 17:54:31 +01:00
|
|
|
# Primary zone definition for {{ item.zone_name }}
|
2016-03-26 18:20:38 +01:00
|
|
|
|
2016-03-26 18:42:13 +01:00
|
|
|
{% for slave in item.slaves|default([]) %}
|
2016-03-26 18:20:38 +01:00
|
|
|
{% 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 -%}
|
|
|
|
|
2016-03-26 17:54:31 +01:00
|
|
|
zone:
|
|
|
|
name: "{{ item.zone_name }}"
|
|
|
|
zonefile: "{{ primary_zones_dir }}/{{ item.zone_filename }}"
|
2016-03-26 18:42:13 +01:00
|
|
|
{% for slave in item.slaves|default([]) %}
|
2016-03-26 18:20:38 +01:00
|
|
|
notify: {{ slave.ip }} "{{ tsigkey(slave) }}"
|
|
|
|
provide-xfr: {{ slave.ip }} "{{ tsigkey(slave) }}"
|
2016-03-26 17:54:31 +01:00
|
|
|
{% endfor %}
|
|
|
|
|