Add a source parameter to bind::zone
Enable zone file initialization using a pre-existing zone file.
This commit is contained in:
parent
4df262281a
commit
2d13b5cf3d
@ -102,6 +102,13 @@ A master zone with DNSSec enabled which allows updates using a TSIG key and zone
|
||||
key_directory => '/var/cache/bind/example.com',
|
||||
}
|
||||
|
||||
A master zone which is initialized with a pre-existing zone file:
|
||||
|
||||
bind::zone { 'example.com':
|
||||
zone_type => 'master',
|
||||
source => 'puppet:///backups/dns/example.com',
|
||||
}
|
||||
|
||||
A slave zone which allows notifications from servers matched by IP:
|
||||
|
||||
bind::zone { 'example.net':
|
||||
|
||||
@ -13,6 +13,7 @@ define bind::zone (
|
||||
$allow_notify = '',
|
||||
$forwarders = '',
|
||||
$forward = '',
|
||||
$source = '',
|
||||
) {
|
||||
$cachedir = $bind::cachedir
|
||||
|
||||
@ -31,6 +32,12 @@ define bind::zone (
|
||||
}
|
||||
|
||||
if $has_zone_file {
|
||||
if $zone_type == 'master' and $source != '' {
|
||||
$_source = $source
|
||||
} else {
|
||||
$_source = 'puppet:///modules/bind/db.empty'
|
||||
}
|
||||
|
||||
file { "${cachedir}/${name}":
|
||||
ensure => directory,
|
||||
owner => $bind::params::bind_user,
|
||||
@ -45,7 +52,7 @@ define bind::zone (
|
||||
group => $bind::params::bind_group,
|
||||
mode => '0644',
|
||||
replace => false,
|
||||
source => 'puppet:///modules/bind/db.empty',
|
||||
source => $_source,
|
||||
audit => [ content ],
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user