support creating server clauses

This commit is contained in:
makeacode 2017-02-01 23:44:15 -05:00
parent e562c613c9
commit ebfa2455a1
4 changed files with 29 additions and 0 deletions

View File

@ -78,6 +78,7 @@ class bind (
"${confdir}/acls.conf",
"${confdir}/keys.conf",
"${confdir}/views.conf",
"${confdir}/servers.conf",
"${confdir}/view-mappings.txt",
"${confdir}/domain-mappings.txt",
]:

17
manifests/server.pp Normal file
View File

@ -0,0 +1,17 @@
# ex: syntax=puppet si ts=4 sw=4 et
define bind::server (
$bogus = false,
$edns = true,
$key = undef,
$transfers = undef,
$order = '10',
) {
include bind
concat::fragment { "bind-server-${name}":
order => $order,
target => "${::bind::confdir}/servers.conf",
content => template('bind/server.erb'),
}
}

View File

@ -2,6 +2,7 @@
include "<%= @confdir %>/acls.conf";
include "<%= @confdir %>/keys.conf";
include "<%= @confdir %>/views.conf";
include "<%= @confdir %>/servers.conf";
<%- if @statistics_port -%>
statistics-channels {

10
templates/server.erb Normal file
View File

@ -0,0 +1,10 @@
server <%= @name %> {
bogus <%= @bogus ? 'yes' : 'no' %>;
edns <%= @edns ? 'yes' : 'no' %>;
<%- if @key -%>
keys <%= @key %>;
<% end -%>
<%- if @transfers -%>
transfers <%= @transfers %>;
<%- end -%>
};