Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging customization #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions manifests/server/conf.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -121,6 +124,7 @@
$keys = {},
$includes = [],
$views = {},
$logging = {},
) {

# OS Defaults
Expand Down
12 changes: 12 additions & 0 deletions templates/named.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ options {
};

logging {
<% if @logging.empty? -%>
channel main_log {
file "/var/log/named/named.log" versions 3 size 5m;
severity info;
Expand All @@ -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 [email protected]? -%>

<% @views.sort_by {|key,value| key}.each do |key,value| -%>
Expand Down