Merge pull request #64 from inkblot/fix-updater-warnings

Put confdir in the params class, and more..
This commit is contained in:
Nate Riffe 2015-12-26 08:53:07 -06:00
commit 07a7aca153
7 changed files with 17 additions and 21 deletions

View File

@ -5,8 +5,8 @@ bind::params::bind_group: 'bind'
bind::params::bind_package: 'bind9'
bind::params::bind_service: 'bind9'
bind::params::nsupdate_package: 'dnsutils'
bind::params::confdir: '/etc/bind'
bind::namedconf: '/etc/bind/named.conf'
bind::confdir: '/etc/bind'
bind::cachedir: '/var/cache/bind'
bind::rndc: true

View File

@ -6,8 +6,8 @@ bind::params::bind_package: 'bind'
bind::params::bind_service: 'named'
bind::params::nsupdate_package: 'bind-utils'
bind::params::managed_keys_directory: '/var/named/dynamic'
bind::params::confdir: '/etc/named'
bind::namedconf: '/etc/named.conf'
bind::confdir: '/etc/named'
bind::cachedir: '/var/named'
bind::rndc: true

View File

@ -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,

View File

@ -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",
}
}

View File

@ -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')

View File

@ -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,
}
}

View File

@ -1,3 +1,3 @@
---
bind::confdir: '_CONFDIR_'
bind::params::confdir: '_CONFDIR_'
bind::namedconf: '_NAMEDCONF_'