From: Frank Brehm Date: Sun, 13 Mar 2016 11:10:43 +0000 (+0100) Subject: Adding option for a zone filename X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=1525d09caa83397287c21a5eae63352d06b22c7d;p=salt%2Fstates.git Adding option for a zone filename --- 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 }};