Skip to content
Snippets Groups Projects
Commit 181e5146 authored by ale's avatar ale
Browse files

Merge branch 'bind-split-zones-by-view' into 'master'

Split zone configs by view

See merge request !301
parents 055617cd 3698a898
No related branches found
No related tags found
1 merge request!301Split zone configs by view
Pipeline #67579 passed
# Script to convert each zone in a view to a series of in-view declarations
1i\
// Automatically generated, do not edit.
/^zone/{
a\
in-view "internal-in";\
};
p
}
...@@ -29,6 +29,11 @@ ...@@ -29,6 +29,11 @@
notify: reload bind notify: reload bind
register: dns_config register: dns_config
- name: Install in-view.sed script
copy:
src: "in-view.sed"
dest: "/etc/bind/in-view.sed"
- name: Create bind9 zone dirs - name: Create bind9 zone dirs
file: file:
path: "/etc/bind/zones" path: "/etc/bind/zones"
...@@ -60,6 +65,7 @@ ...@@ -60,6 +65,7 @@
changed_when: false changed_when: false
with_items: with_items:
- named.conf.zones - named.conf.zones
- named.conf.zones.in-view
- named.conf.internal-custom-zones - named.conf.internal-custom-zones
- named.conf.external-custom-zones - named.conf.external-custom-zones
......
...@@ -32,6 +32,6 @@ view "external-in" in { ...@@ -32,6 +32,6 @@ view "external-in" in {
// Include manually-maintained zones. // Include manually-maintained zones.
include "/etc/bind/named.conf.external-custom-zones"; include "/etc/bind/named.conf.external-custom-zones";
// Include zonetool-maintained zones. // Include zonetool-maintained zones (in-view references).
include "/etc/bind/named.conf.zones"; include "/etc/bind/named.conf.zones.in-view";
}; };
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
# Wrapper for zonetool, with the right options. # Wrapper for zonetool, with the right options.
# #
exec /usr/bin/zonetool \ set -e
/usr/bin/zonetool \
--config /etc/dns/zonetool.yml \ --config /etc/dns/zonetool.yml \
--named-conf /etc/bind/named.conf.zones \ --named-conf /etc/bind/named.conf.zones \
--output-dir /etc/bind/zones --delete \ --output-dir /etc/bind/zones --delete \
...@@ -11,4 +13,10 @@ exec /usr/bin/zonetool \ ...@@ -11,4 +13,10 @@ exec /usr/bin/zonetool \
--ds-dir /etc/bind/dnssec-ds \ --ds-dir /etc/bind/dnssec-ds \
--nsec3-salt {{ dnssec_nsec3_salt }} \ --nsec3-salt {{ dnssec_nsec3_salt }} \
--dnssec-refresh \ --dnssec-refresh \
--update-policy 'grant acme zonesub TXT' \
/etc/dns/manual /etc/dns/auto /etc/dns/manual /etc/dns/auto
sed -n -f /etc/bind/in-view.sed \
/etc/bind/named.conf.zones \
> /etc/bind/named.conf.zones.in-view
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment