Skip to content

Commit

Permalink
add support for keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Seth Lyons authored and sethlyons committed Mar 11, 2015
1 parent 4fa2b9a commit fa21184
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions manifests/server/conf.pp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
# and the value is an array of config lines. Default: empty
# $includes:
# Array of absolute paths to named.conf include files. Default: empty
# $keys:
# Array containing key parameters as key/value pairs
#
# Sample Usage :
# bind::server::conf { '/etc/named.conf':
Expand Down Expand Up @@ -107,6 +109,7 @@
$zones = {},
$includes = [],
$views = {},
$keys = {},
) {

# Everything is inside a single template
Expand Down
12 changes: 11 additions & 1 deletion templates/named.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ acl <%= key %> {
<%= line %>;
<% end -%>
};
<% end -%>
<% end -%>

<% if [email protected]? -%>
<% @keys.sort_by {|key, value| key}.each do |key,value| -%>
key <%= key %> {
<% value.each do |k, v| -%>
<%= k %> <%= v %>;
<% end -%>
};

<% end -%>
<% end -%>
Expand Down Expand Up @@ -106,7 +116,7 @@ logging {
<% if [email protected]? -%>

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

0 comments on commit fa21184

Please sign in to comment.