From ed9359283753b3728758eb6c283201498260e645 Mon Sep 17 00:00:00 2001 From: Trevor Smith Date: Thu, 19 Mar 2015 12:02:07 -0400 Subject: [PATCH 1/6] add namedconf entry that specifies the full path to the named.conf file --- data/osfamily/Debian.yaml | 2 +- data/osfamily/RedHat.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/osfamily/Debian.yaml b/data/osfamily/Debian.yaml index ca071ab..735d72a 100644 --- a/data/osfamily/Debian.yaml +++ b/data/osfamily/Debian.yaml @@ -5,7 +5,7 @@ bind::params::bind_group: 'bind' bind::params::bind_package: 'bind9' bind::params::bind_service: 'bind9' bind::params::nsupdate_package: 'dnsutils' - +bind::namedconf: '/etc/bind/named.conf' bind::confdir: '/etc/bind' bind::cachedir: '/var/cache/bind' bind::rndc: true diff --git a/data/osfamily/RedHat.yaml b/data/osfamily/RedHat.yaml index 13904fd..ac578bc 100644 --- a/data/osfamily/RedHat.yaml +++ b/data/osfamily/RedHat.yaml @@ -5,7 +5,7 @@ bind::params::bind_group: 'named' bind::params::bind_package: 'bind' bind::params::bind_service: 'named' bind::params::nsupdate_package: 'bind-utils' - +bind::namedonf: '/etc/named.conf' bind::confdir: '/etc/named' bind::cachedir: '/var/named' bind::rndc: true From 616b32e8f5e99dbdda2ba6bd06f8c7c2f554c691 Mon Sep 17 00:00:00 2001 From: Trevor Smith Date: Thu, 19 Mar 2015 12:04:43 -0400 Subject: [PATCH 2/6] add namedconf parameter with default undef that will pull it's value for the module_data hiera backend. change the file resource for named.conf to use this value instead of being relative to the confdir parameter. This is needed because redhat based derivatives store the named.conf file under /etc not /etc/named/ --- manifests/init.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 6257df6..c8249e3 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -2,6 +2,7 @@ class bind ( $confdir = undef, + $namedonf = undef, $cachedir = undef, $forwarders = undef, $dnssec = undef, @@ -59,7 +60,7 @@ class bind ( recurse => true, } - file { "${confdir}/named.conf": + file { "${namedconf}": content => template('bind/named.conf.erb'), } From b0e44a1b8ffe8a2960c660b2b811630a6a73e95f Mon Sep 17 00:00:00 2001 From: Trevor Smith Date: Thu, 19 Mar 2015 12:09:14 -0400 Subject: [PATCH 3/6] fix typo --- data/osfamily/RedHat.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/osfamily/RedHat.yaml b/data/osfamily/RedHat.yaml index ac578bc..fc16e8a 100644 --- a/data/osfamily/RedHat.yaml +++ b/data/osfamily/RedHat.yaml @@ -5,7 +5,7 @@ bind::params::bind_group: 'named' bind::params::bind_package: 'bind' bind::params::bind_service: 'named' bind::params::nsupdate_package: 'bind-utils' -bind::namedonf: '/etc/named.conf' +bind::namedconf: '/etc/named.conf' bind::confdir: '/etc/named' bind::cachedir: '/var/named' bind::rndc: true From e27e9a9e85dfd673135c0bd342543e4531e0c58c Mon Sep 17 00:00:00 2001 From: Trevor Smith Date: Thu, 19 Mar 2015 12:10:19 -0400 Subject: [PATCH 4/6] fix typo --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index c8249e3..e50f05f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -2,7 +2,7 @@ class bind ( $confdir = undef, - $namedonf = undef, + $namedconf = undef, $cachedir = undef, $forwarders = undef, $dnssec = undef, From 7a6250d00aec8f7d98037f6121927d4b0082b3bb Mon Sep 17 00:00:00 2001 From: Trevor Smith Date: Thu, 19 Mar 2015 12:14:28 -0400 Subject: [PATCH 5/6] change tests and hiera fixtures to allow tests to pass with the changes to the config path --- spec/classes/bind_spec.rb | 4 ++-- spec/fixtures/hiera/common.yaml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/classes/bind_spec.rb b/spec/classes/bind_spec.rb index 9fada43..20568b7 100644 --- a/spec/classes/bind_spec.rb +++ b/spec/classes/bind_spec.rb @@ -11,8 +11,8 @@ describe 'bind' do }) } - it { should contain_file('_CONFDIR_/named.conf').that_requires('Package[bind]') } - it { should contain_file('_CONFDIR_/named.conf').that_notifies('Service[bind]') } + it { should contain_file('_NAMEDCONF_').that_requires('Package[bind]') } + it { should contain_file('_NAMEDCONF_').that_notifies('Service[bind]') } it { should contain_service('bind').with({ diff --git a/spec/fixtures/hiera/common.yaml b/spec/fixtures/hiera/common.yaml index 631d77d..12f29a7 100644 --- a/spec/fixtures/hiera/common.yaml +++ b/spec/fixtures/hiera/common.yaml @@ -1,2 +1,3 @@ --- bind::confdir: '_CONFDIR_' +bind::namedconf: '_NAMEDCONF_' From 4d4fb12b3cee35d7ac6655e7e92341608ca4234e Mon Sep 17 00:00:00 2001 From: Trevor Smith Date: Thu, 19 Mar 2015 12:23:12 -0400 Subject: [PATCH 6/6] change include statement to fully qualify the params class. This prevents puppet from attempting to include ::params --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index e50f05f..d8a2f07 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -10,7 +10,7 @@ class bind ( $rndc = undef, $statistics_port = undef, ) { - include params + include ::bind::params $auth_nxdomain = false