From 8729a12fbfc8e83b8e94a95023f86fd910df3db0 Mon Sep 17 00:00:00 2001 From: Astro Date: Sat, 23 Jun 2018 02:14:10 +0200 Subject: [PATCH] bind: ctx fixes --- salt/bind/named.conf | 12 ++++++------ salt/bind/reverse.zone | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/salt/bind/named.conf b/salt/bind/named.conf index 0f3ae11..354936b 100644 --- a/salt/bind/named.conf +++ b/salt/bind/named.conf @@ -16,22 +16,22 @@ {%- endmacro %} # root domain -{%- for ctx, domain in pillar['bind']['root-domain'].items() %} -zone "{{ domain }}" IN { +{%- for ctx, root_domain in pillar['bind']['root-domain'].items() %} +zone "{{ root_domain }}" IN { type master; - file "/etc/bind/{{ domain }}.zone"; + file "/etc/bind/{{ root_domain }}.zone"; {{ slaves() }} }; -{%- endfor %} # net zones -{%- for net, subnet4 in pillar['subnets-inet'].items() %} -{%- set domain = net ~ '.' ~ pillar['bind']['root-domain'] %} +{%- for net, subnet4 in pillar['subnets-inet'].items() %} +{%- set domain = net ~ '.' ~ root_domain %} zone "{{ domain }}" IN { type master; file "/etc/bind/{{ domain }}.zone"; {{ slaves() }} }; +{%- endfor %} {%- endfor %} # IPv4 reverse zones diff --git a/salt/bind/reverse.zone b/salt/bind/reverse.zone index 08dc83c..788fc36 100644 --- a/salt/bind/reverse.zone +++ b/salt/bind/reverse.zone @@ -8,7 +8,7 @@ $TTL 10M 2H ; expire 5M ; minimum ) - IN NS {{ pillar['bind']['master-ns'] }}. + IN NS {{ pillar['bind']['master-ns'][ctx] }}. {%- if ctx == 'dn42' %} {%- for net, hosts in pillar['hosts-inet'].items() %}