Put confdir in the params class, and more..
Fix a bunch of warnings whne using the bind::updater class by moving confdir to the params class. In order for this to work, the bind and bind::updater classes both now inherit from params. Also, fix the default value for managed_key_directory to something that's actually falsey.
This commit is contained in:
+6
-12
@@ -1,7 +1,6 @@
|
||||
# ex: syntax=puppet si ts=4 sw=4 et
|
||||
|
||||
class bind (
|
||||
$confdir = undef,
|
||||
$namedconf = undef,
|
||||
$cachedir = undef,
|
||||
$forwarders = undef,
|
||||
@@ -11,18 +10,13 @@ class bind (
|
||||
$statistics_port = undef,
|
||||
$random_device = undef,
|
||||
$include_local = undef,
|
||||
) {
|
||||
include ::bind::params
|
||||
|
||||
# Re-scope members of bind::params for templating
|
||||
$managed_keys_directory = $::bind::params::managed_keys_directory
|
||||
|
||||
) inherits bind::params {
|
||||
$auth_nxdomain = false
|
||||
|
||||
File {
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => $::bind::params::bind_group,
|
||||
group => $bind_group,
|
||||
mode => '0644',
|
||||
require => Package['bind'],
|
||||
notify => Service['bind'],
|
||||
@@ -30,13 +24,13 @@ class bind (
|
||||
|
||||
package{'bind-tools':
|
||||
ensure => latest,
|
||||
name => $::bind::params::nsupdate_package,
|
||||
name => $nsupdate_package,
|
||||
before => Package['bind'],
|
||||
}
|
||||
|
||||
package { 'bind':
|
||||
ensure => latest,
|
||||
name => $::bind::params::bind_package,
|
||||
name => $bind_package,
|
||||
}
|
||||
|
||||
if $dnssec {
|
||||
@@ -79,7 +73,7 @@ class bind (
|
||||
"${confdir}/views.conf",
|
||||
]:
|
||||
owner => 'root',
|
||||
group => $::bind::params::bind_group,
|
||||
group => $bind_group,
|
||||
mode => '0644',
|
||||
require => Package['bind'],
|
||||
notify => Service['bind'],
|
||||
@@ -105,7 +99,7 @@ class bind (
|
||||
|
||||
service { 'bind':
|
||||
ensure => running,
|
||||
name => $::bind::params::bind_service,
|
||||
name => $bind_service,
|
||||
enable => true,
|
||||
hasrestart => true,
|
||||
hasstatus => true,
|
||||
|
||||
+3
-1
@@ -10,6 +10,8 @@ define bind::key (
|
||||
$keyfile = undef,
|
||||
$include = true,
|
||||
) {
|
||||
include bind::params
|
||||
$confdir = $::bind::params::confdir
|
||||
|
||||
# Generate a key of size $secret_bits if no $secret
|
||||
$secret_actual = $secret ? {
|
||||
@@ -43,7 +45,7 @@ define bind::key (
|
||||
|
||||
concat::fragment { "bind-key-${name}":
|
||||
order => '10',
|
||||
target => "${bind::confdir}/keys.conf",
|
||||
target => "${bind::params::confdir}/keys.conf",
|
||||
content => "include \"${keydir}/${key_file_name}\";\n",
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -7,7 +7,8 @@ class bind::params (
|
||||
$bind_package,
|
||||
$bind_service,
|
||||
$nsupdate_package,
|
||||
$managed_keys_directory = nil,
|
||||
$managed_keys_directory = undef,
|
||||
$confdir,
|
||||
) {
|
||||
unless $supported {
|
||||
fail('Platform is not supported')
|
||||
|
||||
@@ -2,13 +2,12 @@
|
||||
|
||||
class bind::updater (
|
||||
$keydir = undef,
|
||||
) {
|
||||
include params
|
||||
) inherits bind::params {
|
||||
|
||||
if $::bind::params::nsupdate_package {
|
||||
if $nsupdate_package {
|
||||
package { 'nsupdate':
|
||||
ensure => present,
|
||||
name => $::bind::params::nsupdate_package,
|
||||
name => $nsupdate_package,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user