Fix up bind::updater and support rndc
I thought I fixed rndc a while ago... not quite. Do it now. Make bind::updater actually work (incomplete last time)
This commit is contained in:
parent
09cf90342b
commit
a66b985adb
@ -1,16 +1,17 @@
|
||||
# ex: syntax=puppet si ts=4 sw=4 et
|
||||
|
||||
class bind (
|
||||
$confdir = $bind::params::confdir,
|
||||
$cachedir = $bind::params::cachedir,
|
||||
$confdir = $::bind::params::confdir,
|
||||
$cachedir = $::bind::params::cachedir,
|
||||
$forwarders = '',
|
||||
$dnssec = true,
|
||||
$version = '',
|
||||
$rndc = $::bind::params::bind_rndc,
|
||||
) inherits bind::params {
|
||||
|
||||
$auth_nxdomain = false
|
||||
|
||||
package { $bind::params::bind_package:
|
||||
package { $::bind::params::bind_package:
|
||||
ensure => latest,
|
||||
}
|
||||
|
||||
@ -29,12 +30,12 @@ class bind (
|
||||
}
|
||||
}
|
||||
|
||||
service { $bind::params::bind_service:
|
||||
service { $::bind::params::bind_service:
|
||||
ensure => running,
|
||||
enable => true,
|
||||
hasrestart => true,
|
||||
hasstatus => true,
|
||||
require => Package[$bind::params::bind_package],
|
||||
require => Package[$::bind::params::bind_package],
|
||||
}
|
||||
|
||||
File {
|
||||
@ -49,23 +50,23 @@ class bind (
|
||||
mode => 2755,
|
||||
purge => true,
|
||||
recurse => true,
|
||||
require => Package[$bind::params::bind_package],
|
||||
require => Package[$::bind::params::bind_package],
|
||||
}
|
||||
|
||||
file { "${confdir}/named.conf":
|
||||
content => template('bind/named.conf.erb'),
|
||||
notify => Service[$bind::params::bind_service],
|
||||
require => Package[$bind::params::bind_package],
|
||||
notify => Service[$::bind::params::bind_service],
|
||||
require => Package[$::bind::params::bind_package],
|
||||
}
|
||||
|
||||
class { 'bind::keydir':
|
||||
keydir => "${confdir}/keys",
|
||||
require => Package[$bind::params::bind_package],
|
||||
require => Package[$::bind::params::bind_package],
|
||||
}
|
||||
|
||||
file { "${confdir}/named.conf.local":
|
||||
replace => false,
|
||||
require => Package[$bind::params::bind_package],
|
||||
require => Package[$::bind::params::bind_package],
|
||||
}
|
||||
|
||||
concat { [
|
||||
@ -74,10 +75,10 @@ class bind (
|
||||
"${confdir}/views.conf",
|
||||
]:
|
||||
owner => 'root',
|
||||
group => $bind::params::bind_group,
|
||||
group => $::bind::params::bind_group,
|
||||
mode => '0644',
|
||||
notify => Service[$bind::params::bind_service],
|
||||
require => Package[$bind::params::bind_package],
|
||||
notify => Service[$::bind::params::bind_service],
|
||||
require => Package[$::bind::params::bind_package],
|
||||
}
|
||||
|
||||
concat::fragment { "named-acls-header":
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
# ex: syntax=puppet si ts=4 sw=4 et
|
||||
|
||||
class bind::keydir (
|
||||
$keydir = "${bind::params::confdir}/keys",
|
||||
$keydir = "${::bind::params::confdir}/keys",
|
||||
) {
|
||||
file { $keydir:
|
||||
ensure => directory,
|
||||
|
||||
@ -10,6 +10,7 @@ class bind::params {
|
||||
$cachedir = '/var/cache/bind'
|
||||
$bind_user = 'bind'
|
||||
$bind_group = 'bind'
|
||||
$bind_rndc = true
|
||||
|
||||
$nsupdate_package = 'dnsutils'
|
||||
|
||||
|
||||
@ -1,14 +1,18 @@
|
||||
# ex: syntax=puppet si ts=4 sw=4 et
|
||||
|
||||
class bind::updater (
|
||||
$nsupdate_package,
|
||||
$keydir =
|
||||
$nsupdate_package = $::bind::params::nsupdate_package,
|
||||
$keydir = "${::bind::params::confdir}/keys",
|
||||
) inherits bind::params {
|
||||
package {'nsupdate':
|
||||
name => $nsupdate_package,
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
file { $::bind::params::confdir:
|
||||
ensure => directory,
|
||||
}
|
||||
|
||||
class { 'bind::keydir':
|
||||
keydir => $keydir,
|
||||
}
|
||||
|
||||
@ -2,6 +2,13 @@
|
||||
include "<%= @confdir %>/acls.conf";
|
||||
include "<%= @confdir %>/keys.conf";
|
||||
include "<%= @confdir %>/views.conf";
|
||||
<%- if @rndc -%>
|
||||
|
||||
include "<%= @confdir %>/rndc.key";
|
||||
controls {
|
||||
inet 127.0.0.1 allow { localhost; } keys { rndc-key; };
|
||||
};
|
||||
<%- end -%>
|
||||
|
||||
options {
|
||||
directory "<%= @cachedir %>";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user