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
|
# ex: syntax=puppet si ts=4 sw=4 et
|
||||||
|
|
||||||
class bind (
|
class bind (
|
||||||
$confdir = $bind::params::confdir,
|
$confdir = $::bind::params::confdir,
|
||||||
$cachedir = $bind::params::cachedir,
|
$cachedir = $::bind::params::cachedir,
|
||||||
$forwarders = '',
|
$forwarders = '',
|
||||||
$dnssec = true,
|
$dnssec = true,
|
||||||
$version = '',
|
$version = '',
|
||||||
|
$rndc = $::bind::params::bind_rndc,
|
||||||
) inherits bind::params {
|
) inherits bind::params {
|
||||||
|
|
||||||
$auth_nxdomain = false
|
$auth_nxdomain = false
|
||||||
|
|
||||||
package { $bind::params::bind_package:
|
package { $::bind::params::bind_package:
|
||||||
ensure => latest,
|
ensure => latest,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,12 +30,12 @@ class bind (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
service { $bind::params::bind_service:
|
service { $::bind::params::bind_service:
|
||||||
ensure => running,
|
ensure => running,
|
||||||
enable => true,
|
enable => true,
|
||||||
hasrestart => true,
|
hasrestart => true,
|
||||||
hasstatus => true,
|
hasstatus => true,
|
||||||
require => Package[$bind::params::bind_package],
|
require => Package[$::bind::params::bind_package],
|
||||||
}
|
}
|
||||||
|
|
||||||
File {
|
File {
|
||||||
@ -49,23 +50,23 @@ class bind (
|
|||||||
mode => 2755,
|
mode => 2755,
|
||||||
purge => true,
|
purge => true,
|
||||||
recurse => true,
|
recurse => true,
|
||||||
require => Package[$bind::params::bind_package],
|
require => Package[$::bind::params::bind_package],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "${confdir}/named.conf":
|
file { "${confdir}/named.conf":
|
||||||
content => template('bind/named.conf.erb'),
|
content => template('bind/named.conf.erb'),
|
||||||
notify => Service[$bind::params::bind_service],
|
notify => Service[$::bind::params::bind_service],
|
||||||
require => Package[$bind::params::bind_package],
|
require => Package[$::bind::params::bind_package],
|
||||||
}
|
}
|
||||||
|
|
||||||
class { 'bind::keydir':
|
class { 'bind::keydir':
|
||||||
keydir => "${confdir}/keys",
|
keydir => "${confdir}/keys",
|
||||||
require => Package[$bind::params::bind_package],
|
require => Package[$::bind::params::bind_package],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "${confdir}/named.conf.local":
|
file { "${confdir}/named.conf.local":
|
||||||
replace => false,
|
replace => false,
|
||||||
require => Package[$bind::params::bind_package],
|
require => Package[$::bind::params::bind_package],
|
||||||
}
|
}
|
||||||
|
|
||||||
concat { [
|
concat { [
|
||||||
@ -74,10 +75,10 @@ class bind (
|
|||||||
"${confdir}/views.conf",
|
"${confdir}/views.conf",
|
||||||
]:
|
]:
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => $bind::params::bind_group,
|
group => $::bind::params::bind_group,
|
||||||
mode => '0644',
|
mode => '0644',
|
||||||
notify => Service[$bind::params::bind_service],
|
notify => Service[$::bind::params::bind_service],
|
||||||
require => Package[$bind::params::bind_package],
|
require => Package[$::bind::params::bind_package],
|
||||||
}
|
}
|
||||||
|
|
||||||
concat::fragment { "named-acls-header":
|
concat::fragment { "named-acls-header":
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# ex: syntax=puppet si ts=4 sw=4 et
|
# ex: syntax=puppet si ts=4 sw=4 et
|
||||||
|
|
||||||
class bind::keydir (
|
class bind::keydir (
|
||||||
$keydir = "${bind::params::confdir}/keys",
|
$keydir = "${::bind::params::confdir}/keys",
|
||||||
) {
|
) {
|
||||||
file { $keydir:
|
file { $keydir:
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
|
|||||||
@ -10,6 +10,7 @@ class bind::params {
|
|||||||
$cachedir = '/var/cache/bind'
|
$cachedir = '/var/cache/bind'
|
||||||
$bind_user = 'bind'
|
$bind_user = 'bind'
|
||||||
$bind_group = 'bind'
|
$bind_group = 'bind'
|
||||||
|
$bind_rndc = true
|
||||||
|
|
||||||
$nsupdate_package = 'dnsutils'
|
$nsupdate_package = 'dnsutils'
|
||||||
|
|
||||||
|
|||||||
@ -1,14 +1,18 @@
|
|||||||
# ex: syntax=puppet si ts=4 sw=4 et
|
# ex: syntax=puppet si ts=4 sw=4 et
|
||||||
|
|
||||||
class bind::updater (
|
class bind::updater (
|
||||||
$nsupdate_package,
|
$nsupdate_package = $::bind::params::nsupdate_package,
|
||||||
$keydir =
|
$keydir = "${::bind::params::confdir}/keys",
|
||||||
) inherits bind::params {
|
) inherits bind::params {
|
||||||
package {'nsupdate':
|
package {'nsupdate':
|
||||||
name => $nsupdate_package,
|
name => $nsupdate_package,
|
||||||
ensure => present,
|
ensure => present,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file { $::bind::params::confdir:
|
||||||
|
ensure => directory,
|
||||||
|
}
|
||||||
|
|
||||||
class { 'bind::keydir':
|
class { 'bind::keydir':
|
||||||
keydir => $keydir,
|
keydir => $keydir,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,13 @@
|
|||||||
include "<%= @confdir %>/acls.conf";
|
include "<%= @confdir %>/acls.conf";
|
||||||
include "<%= @confdir %>/keys.conf";
|
include "<%= @confdir %>/keys.conf";
|
||||||
include "<%= @confdir %>/views.conf";
|
include "<%= @confdir %>/views.conf";
|
||||||
|
<%- if @rndc -%>
|
||||||
|
|
||||||
|
include "<%= @confdir %>/rndc.key";
|
||||||
|
controls {
|
||||||
|
inet 127.0.0.1 allow { localhost; } keys { rndc-key; };
|
||||||
|
};
|
||||||
|
<%- end -%>
|
||||||
|
|
||||||
options {
|
options {
|
||||||
directory "<%= @cachedir %>";
|
directory "<%= @cachedir %>";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user