diff --git a/data/common.yaml b/data/common.yaml index 4ea6bf0..d80d128 100644 --- a/data/common.yaml +++ b/data/common.yaml @@ -5,5 +5,6 @@ bind::forwarders: '' bind::dnssec: true bind::version: '' bind::random_device: '/dev/random' +bind::include_local: false bind::updater::keydir: '/etc/nsupdate-keys' diff --git a/manifests/init.pp b/manifests/init.pp index b131181..881c39e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -10,6 +10,7 @@ class bind ( $rndc = undef, $statistics_port = undef, $random_device = undef, + $include_local = undef, ) { include ::bind::params @@ -35,10 +36,6 @@ class bind ( name => $::bind::params::bind_package, } - file { $::bind::params::bind_files: - ensure => present, - } - if $dnssec { file { '/usr/local/bin/dnssec-init': ensure => present, @@ -60,11 +57,9 @@ class bind ( } } - file { [ "${confdir}/zones" ]: + file { "${confdir}/zones": ensure => directory, mode => '2755', - purge => true, - recurse => true, } file { $namedconf: @@ -75,10 +70,6 @@ class bind ( keydir => "${confdir}/keys", } - file { "${confdir}/named.conf.local": - replace => false, - } - concat { [ "${confdir}/acls.conf", "${confdir}/keys.conf", diff --git a/manifests/params.pp b/manifests/params.pp index 4589e08..36fc987 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -11,21 +11,4 @@ class bind::params ( unless $supported { fail('Platform is not supported') } - - if $::osfamily == 'Debian' { - $bind_files = [ - "${::bind::confdir}/bind.keys", - "${::bind::confdir}/db.empty", - "${::bind::confdir}/db.local", - "${::bind::confdir}/db.root", - "${::bind::confdir}/db.0", - "${::bind::confdir}/db.127", - "${::bind::confdir}/db.255", - "${::bind::confdir}/named.conf.default-zones", - "${::bind::confdir}/zones.rfc1918", - ] - } - elsif $::osfamily == 'RedHat' { - $bind_files = ['/etc/named.root.key'] - } } diff --git a/templates/named.conf.erb b/templates/named.conf.erb index be52acd..070bc04 100644 --- a/templates/named.conf.erb +++ b/templates/named.conf.erb @@ -29,5 +29,7 @@ options { version "<%= @version %>"; <%- end -%> }; +<%- if @include_local -%> include "<%= @confdir %>/named.conf.local"; +<%- end -%>