diff --git a/manifests/server/conf.pp b/manifests/server/conf.pp index 7944be2ee..158c55adc 100644 --- a/manifests/server/conf.pp +++ b/manifests/server/conf.pp @@ -62,6 +62,9 @@ # and the value is an array of config lines. Default: empty # $includes: # Array of absolute paths to named.conf include files. Default: empty +# $logging: +# Hash containing two subhashes: 'channels' and 'categories'. Each key is +# the name for the channel/category and has an Array of config lines. Def: Empty # # Sample Usage : # bind::server::conf { '/etc/named.conf': @@ -121,6 +124,7 @@ $keys = {}, $includes = [], $views = {}, + $logging = {}, ) { # OS Defaults diff --git a/templates/named.conf.erb b/templates/named.conf.erb index 39cd72b8c..dee99ee9e 100644 --- a/templates/named.conf.erb +++ b/templates/named.conf.erb @@ -102,6 +102,7 @@ options { }; logging { +<% if @logging.empty? -%> channel main_log { file "/var/log/named/named.log" versions 3 size 5m; severity info; @@ -115,7 +116,18 @@ logging { category lame-servers { null; }; +<% else -%> + <%- @logging['channels'].sort.each do |key,value| -%> + channel "<%= key %>" { + <%= value.join(";\n ") %> ; + }; + <%- end -%> + <%- @logging['categories'].sort.each do |key,value| -%> + category "<%= key %>" { <%= value.join('; ') -%>; }; + <%- end -%> +<%- end -%> }; + <% if !@views.empty? -%> <% @views.sort_by {|key,value| key}.each do |key,value| -%>