From 2e8002153ab14153f71387d01f7b1789e29dec37 Mon Sep 17 00:00:00 2001 From: b4ldr Date: Mon, 16 Mar 2015 13:11:03 +0000 Subject: [PATCH] add keys support --- manifests/server/conf.pp | 10 ++++++++++ templates/named.conf.erb | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/manifests/server/conf.pp b/manifests/server/conf.pp index 1f11132fc..70988af68 100644 --- a/manifests/server/conf.pp +++ b/manifests/server/conf.pp @@ -54,6 +54,9 @@ # $zones: # Hash of managed zones and their configuration. The key is the zone name # and the value is an array of config lines. Default: empty +# $tsig: +# Hash of managed tsig keys and their configuration. The key is the tsig keys name +# and the value is an array of config lines. Default: empty # $includes: # Array of absolute paths to named.conf include files. Default: empty # @@ -76,6 +79,12 @@ # 'masters { mymasters; }', # ], # } +# keys => { +# 'example.org-tsig' => [ +# 'algorithm hmac-md5', +# 'secret "aaabbbcccddd"', +# ], +# } # } # define bind::server::conf ( @@ -105,6 +114,7 @@ $dnssec_validation = 'yes', $dnssec_lookaside = 'auto', $zones = {}, + $keys = {}, $includes = [], $views = {}, ) { diff --git a/templates/named.conf.erb b/templates/named.conf.erb index bce153ce2..5462d7952 100644 --- a/templates/named.conf.erb +++ b/templates/named.conf.erb @@ -11,6 +11,16 @@ acl <%= key %> { <% end -%> }; +<% end -%> +<% end -%> +<% if !@keys.empty? -%> +<% @keys.sort_by {|key, value| key}.each do |key,value| -%> +key "<%= key %>" { +<% value.each do |line| -%> + <%= line %>; +<% end -%> +}; + <% end -%> <% end -%> <% if !@masters.empty? -%>