Add a zone definition
This commit is contained in:
parent
6800ca9ebc
commit
63b3c4037b
@ -23,6 +23,13 @@ class bind (
|
|||||||
notify => Service[$bind::params::bind_service],
|
notify => Service[$bind::params::bind_service],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file { "${confdir}/zones":
|
||||||
|
ensure => directory,
|
||||||
|
owner => $bind::params::bind_user,
|
||||||
|
group => $bind::params::bind_group,
|
||||||
|
mode => '0755',
|
||||||
|
}
|
||||||
|
|
||||||
concat { [
|
concat { [
|
||||||
"${bind::params::confdir}/acls.conf",
|
"${bind::params::confdir}/acls.conf",
|
||||||
"${bind::params::confdir}/views.conf",
|
"${bind::params::confdir}/views.conf",
|
||||||
|
|||||||
22
manifests/zone.pp
Normal file
22
manifests/zone.pp
Normal 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
29
templates/zone.conf.erb
Normal 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 -%>
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue
Block a user