{% for zone in my_zones %}
{%- set masters = my_zones[zone]['master'] -%}
{%- set slaves = my_zones[zone]['slaves'] -%}
+{%- set filename = my_zones[zone].get('filename', False) -%}
+{%- if not filename -%}
+ {%- set filename = zone + ".zone" -%}
+{%- endif -%}
{%- if grains['fqdn'] in masters|sort %}
zone "{{ zone }}" {
type master;
- file "{{ etc_dir }}/zones/{{ zone }}.zone";
+ file "{{ etc_dir }}/zones/{{ filename }}";
allow-update { none; };
allow-transfer {
common-allow-transfer;
{% for zone in my_zones|sort %}
{%- set masters = my_zones[zone]['master'] -%}
{%- set slaves = my_zones[zone]['slaves'] -%}
+{%- set filename = my_zones[zone].get('filename', False) -%}
+{%- if not filename -%}
+ {%- set filename = zone + ".zone" -%}
+{%- endif -%}
{%- if grains['fqdn'] in slaves %}
zone "{{ zone }}" {
type slave;
- file "{{ zone }}.zone";
+ file "{{ filename }}";
masters {
{%- for master in masters %}{% set ip = masters[master] %}
{{ ip }};