Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion manifests/server/conf.pp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@
# and the value is an array of config lines. Default: empty
# $includes:
# Array of absolute paths to named.conf include files. Default: empty
# $statistics_channels:
# Array of hashes, where each represents a statistics channel with the values 'ip',
# 'port' and 'acl' to apply for a channel.
#
# Sample Usage :
# bind::server::conf { '/etc/named.conf':
# acls => {
# 'rfc1918' => [ '10/8', '172.16/12', '192.168/16' ],
# 'stats' => [ '10/8', 'localhost' ],
# },
# masters => {
# 'mymasters' => [ '192.0.2.1', '198.51.100.1' ],
Expand All @@ -87,7 +91,16 @@
# 'algorithm hmac-md5',
# 'secret "aaabbbcccddd"',
# ],
# }
# },
# statistics_channels => [{
# 'ip' => '127.0.0.1',
# 'port' => '80',
# 'acl' => 'stats',
# }, {
# 'ip' => '10.0.0.1',
# 'port' => '8081',
# 'acl' => 'stats',
# }],
# }
#
define bind::server::conf (
Expand Down Expand Up @@ -121,6 +134,7 @@
$keys = {},
$includes = [],
$views = {},
$statistics_channels = [],
) {

# OS Defaults
Expand Down
8 changes: 8 additions & 0 deletions templates/named.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ zone "<%= key %>" IN {

<% end -%>
<% end -%>
<% if !@statistics_channels.empty? -%>
statistics-channels {
<% @statistics_channels.each do |channel| -%>
inet <%= channel['ip'] %> port <%= channel['port'] %> allow {<%= channel['acl'] %>;};
<% end -%>
};
<% end -%>

<% if @recursion == 'yes' -%>
include "<%= @file_rfc1912 %>";
<% end -%>
Expand Down