From 1525d09caa83397287c21a5eae63352d06b22c7d Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Sun, 13 Mar 2016 12:10:43 +0100 Subject: [PATCH] Adding option for a zone filename --- bind/files/named-pri.conf | 6 +++++- bind/files/named-sec.conf | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bind/files/named-pri.conf b/bind/files/named-pri.conf index 831ea89..8786f69 100644 --- a/bind/files/named-pri.conf +++ b/bind/files/named-pri.conf @@ -16,10 +16,14 @@ {% 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; diff --git a/bind/files/named-sec.conf b/bind/files/named-sec.conf index 3cc2e92..049bd91 100644 --- a/bind/files/named-sec.conf +++ b/bind/files/named-sec.conf @@ -16,10 +16,14 @@ {% 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 }}; -- 2.39.5