Skip to content

Commit

Permalink
Merge branch 'redhat-default-zones' into 6.0-prerelease
Browse files Browse the repository at this point in the history
  • Loading branch information
inkblot committed Jan 29, 2016
2 parents 3333c58 + 44b4b45 commit 43211dc
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions data/osfamily/Debian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ bind::defaults::nsupdate_package: 'dnsutils'
bind::defaults::confdir: '/etc/bind'
bind::defaults::namedconf: '/etc/bind/named.conf'
bind::defaults::cachedir: '/var/cache/bind'
bind::defaults::default_zones_include: '/etc/bind/named.conf.default-zones'

bind::updater::keydir: '/etc/bind/keys'
2 changes: 2 additions & 0 deletions data/osfamily/RedHat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ bind::defaults::confdir: '/etc/named'
bind::defaults::namedconf: '/etc/named.conf'
bind::defaults::cachedir: '/var/named'
bind::defaults::default_zones_warning: true
bind::defaults::default_zones_include: '/etc/named.default-zones.conf'
bind::defaults::default_zones_source: 'puppet:///modules/bind/RedHat/named.default-zones.conf'

bind::updater::keydir: '/etc/named/keys'
6 changes: 6 additions & 0 deletions files/RedHat/named.default-zones.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
zone "." IN {
type hint;
file "named.ca";
};

include "/etc/named.rfc1912.zones";
2 changes: 2 additions & 0 deletions manifests/defaults.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
$nsupdate_package = undef,
$managed_keys_directory = undef,
$default_zones_warning = undef,
$default_zones_include = undef,
$default_zones_source = undef,
) {
unless is_bool($supported) {
fail('Please ensure that the dependencies of the bind module are installed and working correctly')
Expand Down
8 changes: 7 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
$rndc = undef,
$statistics_port = undef,
$auth_nxdomain = false,
$include_local = false,
$include_default_zones = true,
$include_local = false,
) inherits bind::defaults {

File {
Expand Down Expand Up @@ -62,6 +62,12 @@
content => template('bind/named.conf.erb'),
}

if $include_default_zones and $default_zones_source {
file { $default_zones_include:
source => $default_zones_source,
}
}

class { 'bind::keydir':
keydir => "${confdir}/keys",
}
Expand Down
2 changes: 2 additions & 0 deletions manifests/view.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
$order = '10',
) {
$confdir = $::bind::confdir
$default_zones_include = $::bind::default_zones_include
$include_default_zones = $::bind::include_default_zones

concat::fragment { "bind-view-${name}":
order => $order,
Expand Down
4 changes: 2 additions & 2 deletions templates/view.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ view "<%= @name %>" {
};
<%- end -%>
<%- end -%>
<%- if scope.lookupvar('osfamily') == 'Debian' -%>
include "<%= @confdir %>/named.conf.default-zones";
<%- if @include_default_zones and @default_zones_include -%>
include "<%= @default_zones_include %>";
<%- end -%>
<%- Array(@zones).each do |zone| -%>
Expand Down

0 comments on commit 43211dc

Please sign in to comment.