Skip to content

Commit 2e80021

Browse files
committed
add keys support
1 parent 4fa2b9a commit 2e80021

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

manifests/server/conf.pp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
# $zones:
5555
# Hash of managed zones and their configuration. The key is the zone name
5656
# and the value is an array of config lines. Default: empty
57+
# $tsig:
58+
# Hash of managed tsig keys and their configuration. The key is the tsig keys name
59+
# and the value is an array of config lines. Default: empty
5760
# $includes:
5861
# Array of absolute paths to named.conf include files. Default: empty
5962
#
@@ -76,6 +79,12 @@
7679
# 'masters { mymasters; }',
7780
# ],
7881
# }
82+
# keys => {
83+
# 'example.org-tsig' => [
84+
# 'algorithm hmac-md5',
85+
# 'secret "aaabbbcccddd"',
86+
# ],
87+
# }
7988
# }
8089
#
8190
define bind::server::conf (
@@ -105,6 +114,7 @@
105114
$dnssec_validation = 'yes',
106115
$dnssec_lookaside = 'auto',
107116
$zones = {},
117+
$keys = {},
108118
$includes = [],
109119
$views = {},
110120
) {

templates/named.conf.erb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ acl <%= key %> {
1111
<% end -%>
1212
};
1313

14+
<% end -%>
15+
<% end -%>
16+
17+
<% @keys.sort_by {|key, value| key}.each do |key,value| -%>
18+
key "<%= key %>" {
19+
<% value.each do |line| -%>
20+
<%= line %>;
21+
<% end -%>
22+
};
23+
1424
<% end -%>
1525
<% end -%>
1626

0 commit comments

Comments
 (0)