Skip to content

Commit 7dee143

Browse files
committed
Merge pull request #54 from icann-dns/add_tsig_key
add keys support
2 parents 5078607 + 2e80021 commit 7dee143

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
@@ -55,6 +55,9 @@
5555
# $zones:
5656
# Hash of managed zones and their configuration. The key is the zone name
5757
# and the value is an array of config lines. Default: empty
58+
# $tsig:
59+
# Hash of managed tsig keys and their configuration. The key is the tsig keys name
60+
# and the value is an array of config lines. Default: empty
5861
# $includes:
5962
# Array of absolute paths to named.conf include files. Default: empty
6063
#
@@ -77,6 +80,12 @@
7780
# 'masters { mymasters; }',
7881
# ],
7982
# }
83+
# keys => {
84+
# 'example.org-tsig' => [
85+
# 'algorithm hmac-md5',
86+
# 'secret "aaabbbcccddd"',
87+
# ],
88+
# }
8089
# }
8190
#
8291
define bind::server::conf (
@@ -106,6 +115,7 @@
106115
$dnssec_validation = 'yes',
107116
$dnssec_lookaside = 'auto',
108117
$zones = {},
118+
$keys = {},
109119
$includes = [],
110120
$views = {},
111121
) {

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)