From ed7aead85c802ffda0eb468e94f3534415b2d2e5 Mon Sep 17 00:00:00 2001 From: Rowcliffe Browne Date: Fri, 30 Oct 2015 18:28:43 +0800 Subject: [PATCH] allow bind to run in ipv4 or ipv6. if not specified, defaults to bind's default of both. --- bind/config.sls | 12 ++++++++++++ bind/files/debian/default_ipv4 | 7 +++++++ bind/files/debian/default_ipv6 | 7 +++++++ bind/files/redhat/default_ipv4 | 4 ++++ bind/files/redhat/default_ipv6 | 4 ++++ bind/map.jinja | 2 ++ 6 files changed, 36 insertions(+) create mode 100644 bind/files/debian/default_ipv4 create mode 100644 bind/files/debian/default_ipv6 create mode 100644 bind/files/redhat/default_ipv4 create mode 100644 bind/files/redhat/default_ipv6 diff --git a/bind/config.sls b/bind/config.sls index d133a53..214a9bd 100644 --- a/bind/config.sls +++ b/bind/config.sls @@ -67,6 +67,18 @@ bind_local_config: - watch_in: - service: bind +{% if salt['pillar.get']('bind:config:protocol', False) %} +bind_default_config: + file.managed: + - name: {{ map.default_config }} + - source: salt://{{ map.config_source_dir }}/default_{{ salt['pillar.get']('bind:config:protocol', 'ipv4') }} + - user: root + - group: root + - mode: 644 + - watch_in: + - service: bind_restart +{% endif %} + {% if grains['os_family'] == 'Debian' %} bind_key_config: file.managed: diff --git a/bind/files/debian/default_ipv4 b/bind/files/debian/default_ipv4 new file mode 100644 index 0000000..ab39cae --- /dev/null +++ b/bind/files/debian/default_ipv4 @@ -0,0 +1,7 @@ +# run resolvconf? +RESOLVCONF=no + +# startup options for the server +# force ipv4 only +OPTIONS="-4 -u bind" + diff --git a/bind/files/debian/default_ipv6 b/bind/files/debian/default_ipv6 new file mode 100644 index 0000000..084b0ed --- /dev/null +++ b/bind/files/debian/default_ipv6 @@ -0,0 +1,7 @@ +# run resolvconf? +RESOLVCONF=no + +# startup options for the server +# force ipv4 only +OPTIONS="-6 -u bind" + diff --git a/bind/files/redhat/default_ipv4 b/bind/files/redhat/default_ipv4 new file mode 100644 index 0000000..4d7e3a0 --- /dev/null +++ b/bind/files/redhat/default_ipv4 @@ -0,0 +1,4 @@ +# ROOTDIR="/var/named/chroot" +# KEYTAB_FILE="/dir/file" +# DISABLE_ZONE_CHECKING +OPTIONS="-4" diff --git a/bind/files/redhat/default_ipv6 b/bind/files/redhat/default_ipv6 new file mode 100644 index 0000000..6fd43cb --- /dev/null +++ b/bind/files/redhat/default_ipv6 @@ -0,0 +1,4 @@ +# ROOTDIR="/var/named/chroot" +# KEYTAB_FILE="/dir/file" +# DISABLE_ZONE_CHECKING +OPTIONS="-6" diff --git a/bind/map.jinja b/bind/map.jinja index 55eb4ca..977829a 100644 --- a/bind/map.jinja +++ b/bind/map.jinja @@ -8,6 +8,7 @@ 'local_config': '/etc/bind/named.conf.local', 'key_config': '/etc/bind/named.conf.key', 'options_config': '/etc/bind/named.conf.options', + 'default_config': '/etc/default/bind9', 'default_zones_config': '/etc/bind/named.conf.default-zones', 'named_directory': '/var/cache/bind/zones', 'log_dir': '/var/log/bind9', @@ -22,6 +23,7 @@ 'zones_source_dir': '/srv/salt/zones', 'config': '/etc/named.conf', 'local_config': '/etc/named.conf.local', + 'default_config': '/etc/sysconfig/named', 'named_directory': '/var/named/data', 'log_dir': '/var/log/named', 'user': 'root',