Leave distro files alone

Distro packaging includes a lot of configuration files that this module tries
and fails to get rid of, but with exclusions. Those don't always work for
mysterious reasons. Leave the distributed files intact as much as possible,
with just the necessary files touched to effect the desired configuration.

Also, make inclusion of named.conf.local optional (default false) and stop
ensuring that there's at least an empty one.
This commit is contained in:
Nate Riffe 2015-08-20 07:09:09 -05:00
parent 4efa1b956b
commit 2946e51c87
4 changed files with 5 additions and 28 deletions

View File

@ -5,5 +5,6 @@ bind::forwarders: ''
bind::dnssec: true bind::dnssec: true
bind::version: '' bind::version: ''
bind::random_device: '/dev/random' bind::random_device: '/dev/random'
bind::include_local: false
bind::updater::keydir: '/etc/nsupdate-keys' bind::updater::keydir: '/etc/nsupdate-keys'

View File

@ -10,6 +10,7 @@ class bind (
$rndc = undef, $rndc = undef,
$statistics_port = undef, $statistics_port = undef,
$random_device = undef, $random_device = undef,
$include_local = undef,
) { ) {
include ::bind::params include ::bind::params
@ -35,10 +36,6 @@ class bind (
name => $::bind::params::bind_package, name => $::bind::params::bind_package,
} }
file { $::bind::params::bind_files:
ensure => present,
}
if $dnssec { if $dnssec {
file { '/usr/local/bin/dnssec-init': file { '/usr/local/bin/dnssec-init':
ensure => present, ensure => present,
@ -60,11 +57,9 @@ class bind (
} }
} }
file { [ "${confdir}/zones" ]: file { "${confdir}/zones":
ensure => directory, ensure => directory,
mode => '2755', mode => '2755',
purge => true,
recurse => true,
} }
file { $namedconf: file { $namedconf:
@ -75,10 +70,6 @@ class bind (
keydir => "${confdir}/keys", keydir => "${confdir}/keys",
} }
file { "${confdir}/named.conf.local":
replace => false,
}
concat { [ concat { [
"${confdir}/acls.conf", "${confdir}/acls.conf",
"${confdir}/keys.conf", "${confdir}/keys.conf",

View File

@ -11,21 +11,4 @@ class bind::params (
unless $supported { unless $supported {
fail('Platform is not 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']
}
} }

View File

@ -29,5 +29,7 @@ options {
version "<%= @version %>"; version "<%= @version %>";
<%- end -%> <%- end -%>
}; };
<%- if @include_local -%>
include "<%= @confdir %>/named.conf.local"; include "<%= @confdir %>/named.conf.local";
<%- end -%>