Add bind::updater class
Create a bind::updater class to add support for the dns_rr resource on systems that will not have a BIND server installed or running.
This commit is contained in:
parent
c4bc2a1c4a
commit
09cf90342b
@ -14,6 +14,11 @@ class bind (
|
|||||||
ensure => latest,
|
ensure => latest,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file { $::bind::params::bind_files:
|
||||||
|
ensure => present,
|
||||||
|
require => Package[$bind_package],
|
||||||
|
}
|
||||||
|
|
||||||
if $dnssec {
|
if $dnssec {
|
||||||
file { '/usr/local/bin/dnssec-init':
|
file { '/usr/local/bin/dnssec-init':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
@ -53,9 +58,8 @@ class bind (
|
|||||||
require => Package[$bind::params::bind_package],
|
require => Package[$bind::params::bind_package],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "${confdir}/keys":
|
class { 'bind::keydir':
|
||||||
ensure => directory,
|
keydir => "${confdir}/keys",
|
||||||
mode => 0755,
|
|
||||||
require => Package[$bind::params::bind_package],
|
require => Package[$bind::params::bind_package],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,18 +5,22 @@ define bind::key (
|
|||||||
$secret,
|
$secret,
|
||||||
$owner = 'root',
|
$owner = 'root',
|
||||||
$group = $bind::params::bind_group,
|
$group = $bind::params::bind_group,
|
||||||
path = "${::bind::confdir}/keys"
|
|
||||||
) {
|
) {
|
||||||
file { "${path}/${name}":
|
$keydir = $::bind::keydir::keydir
|
||||||
|
|
||||||
|
file { "${keydir}/${name}":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
owner => $owner,
|
owner => $owner,
|
||||||
group => $group,
|
group => $group,
|
||||||
mode => '0640',
|
mode => '0640',
|
||||||
content => template('bind/key.conf.erb'),
|
content => template('bind/key.conf.erb'),
|
||||||
notify => Service[$bind::params::bind_service],
|
|
||||||
require => Package[$bind::params::bind_package],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined(Class['bind'])) {
|
if (defined(Class['bind'])) {
|
||||||
|
Package[$bind::params::bind_package] ->
|
||||||
|
File["${keydir}/${name}"] ~>
|
||||||
|
Service[$bind::params::bind_service]
|
||||||
|
|
||||||
concat::fragment { "bind-key-${name}":
|
concat::fragment { "bind-key-${name}":
|
||||||
order => '10',
|
order => '10',
|
||||||
target => "${bind::confdir}/keys.conf",
|
target => "${bind::confdir}/keys.conf",
|
||||||
|
|||||||
10
manifests/keydir.pp
Normal file
10
manifests/keydir.pp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# ex: syntax=puppet si ts=4 sw=4 et
|
||||||
|
|
||||||
|
class bind::keydir (
|
||||||
|
$keydir = "${bind::params::confdir}/keys",
|
||||||
|
) {
|
||||||
|
file { $keydir:
|
||||||
|
ensure => directory,
|
||||||
|
mode => 0755,
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -11,7 +11,9 @@ class bind::params {
|
|||||||
$bind_user = 'bind'
|
$bind_user = 'bind'
|
||||||
$bind_group = 'bind'
|
$bind_group = 'bind'
|
||||||
|
|
||||||
file { [
|
$nsupdate_package = 'dnsutils'
|
||||||
|
|
||||||
|
$bind_files = [
|
||||||
"${confdir}/bind.keys",
|
"${confdir}/bind.keys",
|
||||||
"${confdir}/db.empty",
|
"${confdir}/db.empty",
|
||||||
"${confdir}/db.local",
|
"${confdir}/db.local",
|
||||||
@ -22,10 +24,7 @@ class bind::params {
|
|||||||
"${confdir}/named.conf.default-zones",
|
"${confdir}/named.conf.default-zones",
|
||||||
"${confdir}/rndc.key",
|
"${confdir}/rndc.key",
|
||||||
"${confdir}/zones.rfc1918",
|
"${confdir}/zones.rfc1918",
|
||||||
]:
|
]
|
||||||
ensure => present,
|
|
||||||
require => Package[$bind_package],
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
fail("Operating system is not supported ${::osfamily}")
|
fail("Operating system is not supported ${::osfamily}")
|
||||||
|
|||||||
15
manifests/updater.pp
Normal file
15
manifests/updater.pp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# ex: syntax=puppet si ts=4 sw=4 et
|
||||||
|
|
||||||
|
class bind::updater (
|
||||||
|
$nsupdate_package,
|
||||||
|
$keydir =
|
||||||
|
) inherits bind::params {
|
||||||
|
package {'nsupdate':
|
||||||
|
name => $nsupdate_package,
|
||||||
|
ensure => present,
|
||||||
|
}
|
||||||
|
|
||||||
|
class { 'bind::keydir':
|
||||||
|
keydir => $keydir,
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user