Make it all work again.

Previous iterations and even a release were all broken. The module works again,
sorry for the interlude.

- Giving up on params and moving to module_data (WIP)
- Change the Package and Service references to the static 'bind' name
- Add a meager amount of test coverage
This commit is contained in:
Nate Riffe
2015-01-08 08:09:32 -06:00
parent f7740f2a05
commit 7a74314a1e
21 changed files with 156 additions and 88 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ define bind::acl (
concat::fragment { "bind-acl-${name}":
order => '10',
target => "${bind::params::confdir}/acls.conf",
target => "${bind::confdir}/acls.conf",
content => template('bind/acl.erb'),
}
+6 -6
View File
@@ -1,12 +1,12 @@
# ex: syntax=puppet si ts=4 sw=4 et
class bind (
$confdir = $::bind::params::confdir,
$cachedir = $::bind::params::cachedir,
$forwarders = '',
$dnssec = true,
$version = '',
$rndc = $::bind::params::bind_rndc,
$confdir = undef,
$cachedir = undef,
$forwarders = undef,
$dnssec = undef,
$version = undef,
$rndc = undef,
) {
include params
+1 -3
View File
@@ -17,9 +17,7 @@ define bind::key (
}
if (defined(Class['bind'])) {
Package[$bind::params::bind_package] ->
File["${keydir}/${name}"] ~>
Service[$bind::params::bind_service]
Package['bind'] -> File["${keydir}/${name}"] ~> Service['bind']
concat::fragment { "bind-key-${name}":
order => '10',
+1 -1
View File
@@ -1,7 +1,7 @@
# ex: syntax=puppet si ts=4 sw=4 et
class bind::keydir (
$keydir = "${::bind::params::confdir}/keys",
$keydir,
) {
file { $keydir:
ensure => directory,
+24 -30
View File
@@ -1,35 +1,29 @@
# ex: syntax=puppet si ts=4 sw=4 et
class bind::params {
case $::osfamily {
'Debian': {
$bind_package = 'bind9'
$bind_service = 'bind9'
$confdir = '/etc/bind'
$cachedir = '/var/cache/bind'
$bind_user = 'bind'
$bind_group = 'bind'
$bind_rndc = true
$nsupdate_package = 'dnsutils'
$bind_files = [
"${confdir}/bind.keys",
"${confdir}/db.empty",
"${confdir}/db.local",
"${confdir}/db.root",
"${confdir}/db.0",
"${confdir}/db.127",
"${confdir}/db.255",
"${confdir}/named.conf.default-zones",
"${confdir}/rndc.key",
"${confdir}/zones.rfc1918",
]
}
default: {
fail("Operating system is not supported ${::osfamily}")
}
class bind::params (
$supported,
$bind_user,
$bind_group,
$bind_package,
$bind_service,
$nsupdate_package,
) {
unless $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}/rndc.key",
"${::bind::confdir}/zones.rfc1918",
]
}
}
+6 -9
View File
@@ -1,18 +1,15 @@
# ex: syntax=puppet si ts=4 sw=4 et
class bind::updater (
$nsupdate_package = $::bind::params::nsupdate_package,
$keydir = "${::bind::params::confdir}/keys",
$keydir = undef,
) {
include params
package {'nsupdate':
ensure => present,
name => $nsupdate_package,
}
file { $::bind::params::confdir:
ensure => directory,
if $::bind::params::nsupdate_package {
package { 'nsupdate':
ensure => present,
name => $::bind::params::nsupdate_package,
}
}
class { 'bind::keydir':
+2 -2
View File
@@ -8,11 +8,11 @@ define bind::view (
$recursion_match_clients = 'any',
$recursion_match_destinations = '',
) {
$confdir = $bind::params::confdir
$confdir = $::bind::confdir
concat::fragment { "bind-view-${name}":
order => '10',
target => "${bind::params::confdir}/views.conf",
target => "${::bind::confdir}/views.conf",
content => template('bind/view.erb'),
}
}
+3 -3
View File
@@ -43,7 +43,7 @@ define bind::zone (
owner => $bind::params::bind_user,
group => $bind::params::bind_group,
mode => '0755',
require => Package[$bind::params::bind_package],
require => Package['bind'],
}
file { "${cachedir}/${name}/${_domain}":
@@ -85,8 +85,8 @@ define bind::zone (
group => $bind::params::bind_group,
mode => '0644',
content => template('bind/zone.conf.erb'),
notify => Service[$bind::params::bind_service],
require => Package[$bind::params::bind_package],
notify => Service['bind'],
require => Package['bind'],
}
}