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 17, 2015
1 parent c7417a7 commit 525c08d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
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
19 changes: 19 additions & 0 deletions 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 @@ -118,6 +128,15 @@ view "<%= key %>" {
include "<%= filename %>";
<% end -%>
<% end -%>
<% if value['server'] and !value['server'].empty? -%>
<% value['server'].sort_by {|key, value| key}.each do |key,value| -%>
server <%= key %> {
<% value.each do |line| -%>
<%= line %>;
<% end -%>
};
<% end -%>
<% end -%>
<% if value['zones'] and !value['zones'].empty? -%>
/* View specific zones */
<% value['zones'].sort_by {|key, value| key}.each do |key,value| -%>
Expand Down

0 comments on commit 525c08d

Please sign in to comment.