Include the default zones on RedHat
RedHat's default zones are baked into the stock named.conf, which the module's template completely rewrites. Since the module is extremely view-based, and the Debian default-zones are repositioned into the zones, let's take those defaults out of the stock named.conf, build a configuration file out of them and include it in the view just the same.
This commit is contained in:
parent
3333c58e33
commit
57002c31a4
@ -8,5 +8,6 @@ bind::defaults::nsupdate_package: 'dnsutils'
|
|||||||
bind::defaults::confdir: '/etc/bind'
|
bind::defaults::confdir: '/etc/bind'
|
||||||
bind::defaults::namedconf: '/etc/bind/named.conf'
|
bind::defaults::namedconf: '/etc/bind/named.conf'
|
||||||
bind::defaults::cachedir: '/var/cache/bind'
|
bind::defaults::cachedir: '/var/cache/bind'
|
||||||
|
bind::defaults::default_zones_include: '/etc/bind/named.conf.default-zones'
|
||||||
|
|
||||||
bind::updater::keydir: '/etc/bind/keys'
|
bind::updater::keydir: '/etc/bind/keys'
|
||||||
|
|||||||
@ -10,5 +10,7 @@ bind::defaults::confdir: '/etc/named'
|
|||||||
bind::defaults::namedconf: '/etc/named.conf'
|
bind::defaults::namedconf: '/etc/named.conf'
|
||||||
bind::defaults::cachedir: '/var/named'
|
bind::defaults::cachedir: '/var/named'
|
||||||
bind::defaults::default_zones_warning: true
|
bind::defaults::default_zones_warning: true
|
||||||
|
bind::defaults::default_zones_include: '/etc/named.default-zones.conf'
|
||||||
|
bind::defaults::default_zones_source: 'puppet:///module/bind/RedHat/named.default-zones.conf'
|
||||||
|
|
||||||
bind::updater::keydir: '/etc/named/keys'
|
bind::updater::keydir: '/etc/named/keys'
|
||||||
|
|||||||
6
files/RedHat/named.default-zones.conf
Normal file
6
files/RedHat/named.default-zones.conf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
zone "." IN {
|
||||||
|
type hint;
|
||||||
|
file "named.ca";
|
||||||
|
};
|
||||||
|
|
||||||
|
include "/etc/named.rfc1912.zones";
|
||||||
@ -13,6 +13,8 @@ class bind::defaults (
|
|||||||
$nsupdate_package = undef,
|
$nsupdate_package = undef,
|
||||||
$managed_keys_directory = undef,
|
$managed_keys_directory = undef,
|
||||||
$default_zones_warning = undef,
|
$default_zones_warning = undef,
|
||||||
|
$default_zones_include = undef,
|
||||||
|
$default_zones_source = undef,
|
||||||
) {
|
) {
|
||||||
unless is_bool($supported) {
|
unless is_bool($supported) {
|
||||||
fail('Please ensure that the dependencies of the bind module are installed and working correctly')
|
fail('Please ensure that the dependencies of the bind module are installed and working correctly')
|
||||||
|
|||||||
@ -62,6 +62,12 @@ class bind (
|
|||||||
content => template('bind/named.conf.erb'),
|
content => template('bind/named.conf.erb'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $default_zones_source {
|
||||||
|
file { $default_zones_include:
|
||||||
|
source => $default_zones_source,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class { 'bind::keydir':
|
class { 'bind::keydir':
|
||||||
keydir => "${confdir}/keys",
|
keydir => "${confdir}/keys",
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,6 +12,7 @@ define bind::view (
|
|||||||
$order = '10',
|
$order = '10',
|
||||||
) {
|
) {
|
||||||
$confdir = $::bind::confdir
|
$confdir = $::bind::confdir
|
||||||
|
$default_zones_include = $::bind::default_zones_include
|
||||||
|
|
||||||
concat::fragment { "bind-view-${name}":
|
concat::fragment { "bind-view-${name}":
|
||||||
order => $order,
|
order => $order,
|
||||||
|
|||||||
@ -44,8 +44,8 @@ view "<%= @name %>" {
|
|||||||
};
|
};
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
<%- if scope.lookupvar('osfamily') == 'Debian' -%>
|
<%- if @default_zones_include -%>
|
||||||
include "<%= @confdir %>/named.conf.default-zones";
|
include "<%= @default_zones_include %>";
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
|
|
||||||
<%- Array(@zones).each do |zone| -%>
|
<%- Array(@zones).each do |zone| -%>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user