diff --git a/manifests/server/conf.pp b/manifests/server/conf.pp index 14fcbc1fc..e1921f806 100644 --- a/manifests/server/conf.pp +++ b/manifests/server/conf.pp @@ -5,6 +5,8 @@ # Parameters: # $acls: # Hash of client ACLs, name as key and array of config lines. Default: empty +# $controls: +# Hash of administrative channels, inet as key and array of config lines. Default: empty # $masters: # Hash of master ACLs, name as key and array of config lines. Default: empty # $listen_on_port: @@ -66,6 +68,12 @@ # acls => { # 'rfc1918' => [ '10/8', '172.16/12', '192.168/16' ], # }, +# controls => { +# '127.0.0.1' => { +# address_match_list => ['localhost'], +# keys_list => ['rndc-key'], +# port => 953, +# }, # masters => { # 'mymasters' => [ '192.0.2.1', '198.51.100.1' ], # }, @@ -80,7 +88,7 @@ # 'masters { mymasters; }', # ], # } -# keys => { +# keys => { # 'example.org-tsig' => [ # 'algorithm hmac-md5', # 'secret "aaabbbcccddd"', @@ -90,6 +98,7 @@ # define bind::server::conf ( $acls = {}, + $controls = {}, $masters = {}, $listen_on_port = '53', $listen_on_addr = [ '127.0.0.1' ], diff --git a/spec/fixtures/manifests/site.pp b/spec/fixtures/manifests/site.pp new file mode 100644 index 000000000..e69de29bb diff --git a/templates/named.conf.erb b/templates/named.conf.erb index 8d0c47155..9e566be63 100644 --- a/templates/named.conf.erb +++ b/templates/named.conf.erb @@ -12,6 +12,24 @@ acl <%= key %> { }; <% end -%> +<% end -%> +<% unless @controls.empty? -%> +controls { +<% @controls.each do |inet, settings| + next unless settings.has_key? 'address_match_list' and settings['address_match_list'].is_a? Array + control_settings = '' + if settings.has_key? 'port' + control_settings << " port #{settings['port']}" + end + control_settings << " allow { #{settings['address_match_list'].join('; ')}; }" + if settings.has_key? 'keys_list' and settings['keys_list'].is_a? Array + control_settings << " keys { #{settings['keys_list'].join('; ')}; }" + end +-%> + inet <%= inet %><%= control_settings %>; +<% end -%> +}; + <% end -%> <% if !@keys.empty? -%> <% @keys.sort_by {|key, value| key}.each do |key,value| -%>