Add a zone definition

This commit is contained in:
Nate Riffe 2012-09-04 07:24:31 -05:00
parent 6800ca9ebc
commit 63b3c4037b
3 changed files with 58 additions and 0 deletions

View File

@ -23,6 +23,13 @@ class bind (
notify => Service[$bind::params::bind_service],
}
file { "${confdir}/zones":
ensure => directory,
owner => $bind::params::bind_user,
group => $bind::params::bind_group,
mode => '0755',
}
concat { [
"${bind::params::confdir}/acls.conf",
"${bind::params::confdir}/views.conf",

22
manifests/zone.pp Normal file
View File

@ -0,0 +1,22 @@
define bind::zone (
$type,
$domain = '',
$masters = [],
$allow_updates = [],
$allow_transfers = [],
) {
if $domain == ''
$_domain = $name
else
$_domain = $domain
fi
file { "${bind::params::confdir}/zones/${name}.conf":
ensure => present,
owner => ${bind::params::bind_user},
group => ${bind::params::bind_group},
mode => '0644',
content => template('bind/zone.conf.erb'),
}
}

29
templates/zone.conf.erb Normal file
View File

@ -0,0 +1,29 @@
# This file managed by puppet - changes will be lost
zone "<%= _domain %>" {
type <%= type %>;
<%- if file != '' -%>
file "<%= file %>";
<%- end -%>
<%- if not masters.empty? -%>
masters {
<%- masters.each do |master| -%>
<%= master %>;
<%- end -%>
};
<%- end -%>
<%- if not allow_updates.empty? -%>
allow-update {
<%- allow_updates.each do |allow_update| -%>
<%= allow_update %>;
<%- end -%>
};
<%- end -%>
<%- if not allow_transfers.empty? -%>
allow-transfer {
<%- allow_transfers.each do |allow_transfer| -%>
<%= allow_transfer %>;
<%- end -%>
};
<%- end -%>
};