Add warnings and safety checks and documentation

The changes in the `redhat-default-zones` branch, when released, may cause
upgrade difficulties for Red Hat system administrators. Try to ease the
transition.
This commit is contained in:
Nate Riffe
2016-01-07 20:37:17 -06:00
parent d5e1b19b1a
commit ae3bfa7f1b
7 changed files with 121 additions and 8 deletions
+1
View File
@@ -12,6 +12,7 @@ class bind::defaults (
$bind_service = undef,
$nsupdate_package = undef,
$managed_keys_directory = undef,
$default_zones_warning = undef,
) {
unless is_bool($supported) {
fail('Please ensure that the dependencies of the bind module are installed and working correctly')
+8 -7
View File
@@ -1,13 +1,14 @@
# ex: syntax=puppet si ts=4 sw=4 et
class bind (
$forwarders = '',
$dnssec = true,
$version = '',
$rndc = undef,
$statistics_port = undef,
$auth_nxdomain = false,
$include_local = false,
$forwarders = '',
$dnssec = true,
$version = '',
$rndc = undef,
$statistics_port = undef,
$auth_nxdomain = false,
$include_local = false,
$include_default_zones = true,
) inherits bind::defaults {
File {
+7 -1
View File
@@ -22,14 +22,20 @@ define bind::zone (
# where there is a zone, there is a server
include bind
# Pull some platform defaults into the local scope
# Pull some platform defaults and `bind` class parameters into the local scope
$cachedir = $::bind::defaults::cachedir
$random_device = $::bind::defaults::random_device
$bind_user = $::bind::defaults::bind_user
$bind_group = $::bind::defaults::bind_group
$default_zones_warning = $::bind::defaults::default_zones_warning
$include_default_zones = $::bind::include_default_zones
$_domain = pick($domain, $name)
if $include_default_zones and $default_zones_warning and member(['.', 'localhost', '127.in-addr.arpa', '0.in-addr.arpa', '255.in-addr.arpa'], $_domain) {
warning("The bind module will include a default definition for zone \"${_domain}\" starting in version 6.0.0. Please see https://github.com/inkblot/puppet-bind/blob/master/DEFAULT_ZONES.md for more information about how this will affect your configuration.")
}
unless !($masters != '' and ! member(['slave', 'stub'], $zone_type)) {
fail("masters may only be provided for bind::zone resources with zone_type 'slave' or 'stub'")
}