Skip to content

Commit fa21184

Browse files
Seth Lyonssethlyons
authored andcommitted
add support for keys
1 parent 4fa2b9a commit fa21184

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

manifests/server/conf.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
# and the value is an array of config lines. Default: empty
5757
# $includes:
5858
# Array of absolute paths to named.conf include files. Default: empty
59+
# $keys:
60+
# Array containing key parameters as key/value pairs
5961
#
6062
# Sample Usage :
6163
# bind::server::conf { '/etc/named.conf':
@@ -107,6 +109,7 @@
107109
$zones = {},
108110
$includes = [],
109111
$views = {},
112+
$keys = {},
110113
) {
111114

112115
# Everything is inside a single template

templates/named.conf.erb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ acl <%= key %> {
1010
<%= line %>;
1111
<% end -%>
1212
};
13+
<% end -%>
14+
<% end -%>
15+
16+
17+
<% @keys.sort_by {|key, value| key}.each do |key,value| -%>
18+
key <%= key %> {
19+
<% value.each do |k, v| -%>
20+
<%= k %> <%= v %>;
21+
<% end -%>
22+
};
1323

1424
<% end -%>
1525
<% end -%>
@@ -106,7 +116,7 @@ logging {
106116
107117

108118
<% @views.sort_by {|key,value| key}.each do |key,value| -%>
109-
<% valid_keys = %w(allow-notify allow-query allow-recursion allow-transfer allow-update-forwarding forwarders match-clients match-destinations match-recursive-only) -%>
119+
<% valid_keys = %w(allow-notify allow-query allow-recursion allow-transfer allow-update-forwarding forwarders match-clients match-destinations match-recursive-only server) -%>
110120
view "<%= key %>" {
111121
<% valid_keys.sort.each do |valid_key| -%>
112122
<% if value[valid_key] and !value[valid_key].empty? -%>

0 commit comments

Comments
 (0)