Skip to content

Commit 07a7aca

Browse files
committed
Merge pull request thias#64 from inkblot/fix-updater-warnings
Put confdir in the params class, and more..
2 parents 1af06cb + 250cb4e commit 07a7aca

7 files changed

Lines changed: 17 additions & 21 deletions

File tree

data/osfamily/Debian.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ bind::params::bind_group: 'bind'
55
bind::params::bind_package: 'bind9'
66
bind::params::bind_service: 'bind9'
77
bind::params::nsupdate_package: 'dnsutils'
8+
bind::params::confdir: '/etc/bind'
89
bind::namedconf: '/etc/bind/named.conf'
9-
bind::confdir: '/etc/bind'
1010
bind::cachedir: '/var/cache/bind'
1111
bind::rndc: true
1212

data/osfamily/RedHat.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ bind::params::bind_package: 'bind'
66
bind::params::bind_service: 'named'
77
bind::params::nsupdate_package: 'bind-utils'
88
bind::params::managed_keys_directory: '/var/named/dynamic'
9+
bind::params::confdir: '/etc/named'
910
bind::namedconf: '/etc/named.conf'
10-
bind::confdir: '/etc/named'
1111
bind::cachedir: '/var/named'
1212
bind::rndc: true
1313

manifests/init.pp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# ex: syntax=puppet si ts=4 sw=4 et
22

33
class bind (
4-
$confdir = undef,
54
$namedconf = undef,
65
$cachedir = undef,
76
$forwarders = undef,
@@ -11,32 +10,27 @@
1110
$statistics_port = undef,
1211
$random_device = undef,
1312
$include_local = undef,
14-
) {
15-
include ::bind::params
16-
17-
# Re-scope members of bind::params for templating
18-
$managed_keys_directory = $::bind::params::managed_keys_directory
19-
13+
) inherits bind::params {
2014
$auth_nxdomain = false
2115

2216
File {
2317
ensure => present,
2418
owner => 'root',
25-
group => $::bind::params::bind_group,
19+
group => $bind_group,
2620
mode => '0644',
2721
require => Package['bind'],
2822
notify => Service['bind'],
2923
}
3024

3125
package{'bind-tools':
3226
ensure => latest,
33-
name => $::bind::params::nsupdate_package,
27+
name => $nsupdate_package,
3428
before => Package['bind'],
3529
}
3630

3731
package { 'bind':
3832
ensure => latest,
39-
name => $::bind::params::bind_package,
33+
name => $bind_package,
4034
}
4135

4236
if $dnssec {
@@ -79,7 +73,7 @@
7973
"${confdir}/views.conf",
8074
]:
8175
owner => 'root',
82-
group => $::bind::params::bind_group,
76+
group => $bind_group,
8377
mode => '0644',
8478
require => Package['bind'],
8579
notify => Service['bind'],
@@ -105,7 +99,7 @@
10599

106100
service { 'bind':
107101
ensure => running,
108-
name => $::bind::params::bind_service,
102+
name => $bind_service,
109103
enable => true,
110104
hasrestart => true,
111105
hasstatus => true,

manifests/key.pp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
$keyfile = undef,
1111
$include = true,
1212
) {
13+
include bind::params
14+
$confdir = $::bind::params::confdir
1315

1416
# Generate a key of size $secret_bits if no $secret
1517
$secret_actual = $secret ? {
@@ -43,7 +45,7 @@
4345

4446
concat::fragment { "bind-key-${name}":
4547
order => '10',
46-
target => "${bind::confdir}/keys.conf",
48+
target => "${bind::params::confdir}/keys.conf",
4749
content => "include \"${keydir}/${key_file_name}\";\n",
4850
}
4951
}

manifests/params.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
$bind_package,
88
$bind_service,
99
$nsupdate_package,
10-
$managed_keys_directory = nil,
10+
$managed_keys_directory = undef,
11+
$confdir,
1112
) {
1213
unless $supported {
1314
fail('Platform is not supported')

manifests/updater.pp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
class bind::updater (
44
$keydir = undef,
5-
) {
6-
include params
5+
) inherits bind::params {
76

8-
if $::bind::params::nsupdate_package {
7+
if $nsupdate_package {
98
package { 'nsupdate':
109
ensure => present,
11-
name => $::bind::params::nsupdate_package,
10+
name => $nsupdate_package,
1211
}
1312
}
1413

spec/fixtures/hiera/common.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
---
2-
bind::confdir: '_CONFDIR_'
2+
bind::params::confdir: '_CONFDIR_'
33
bind::namedconf: '_NAMEDCONF_'

0 commit comments

Comments
 (0)