Skip to content

Commit 803c93e

Browse files
Seth Lyonssethlyons
authored andcommitted
add support for keys
1 parent c7417a7 commit 803c93e

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
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: 15 additions & 0 deletions
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 -%>
@@ -118,6 +128,11 @@ view "<%= key %>" {
118128
include "<%= filename %>";
119129
<% end -%>
120130
<% end -%>
131+
<% if value['server'] and !value['server'].empty? -%>
132+
<% value['server'].sort_by {|key, value| key}.each do |key,value| -%>
133+
server <%= value['server'] %> { <%= key %> <%= value %> }
134+
<% end -%>
135+
<% end -%>
121136
<% if value['zones'] and !value['zones'].empty? -%>
122137
/* View specific zones */
123138
<% value['zones'].sort_by {|key, value| key}.each do |key,value| -%>

0 commit comments

Comments
 (0)