Skip to content

implement optional logging w/ custom_logging option #92

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

Open
wants to merge 2 commits 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
8 changes: 8 additions & 0 deletions manifests/server/conf.pp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
# and the value is an array of config lines. Default: empty
# $includes:
# Array of absolute paths to named.conf include files. Default: empty
# $logging:
# Boolean to include default logging options
# Default: true
# $custom_logging:
# Hash of logging options (currently limited to ['category','channel'] per named.conf
# Example: {channel => {security => {key => val, }}, category => {security => {}}
#
# Sample Usage :
# bind::server::conf { '/etc/named.conf':
Expand Down Expand Up @@ -107,6 +113,8 @@
$allow_query = [ 'localhost' ],
$allow_query_cache = [],
$recursion = 'yes',
$logging = true,
$custom_logging = {},
$allow_recursion = [],
$allow_transfer = [],
$check_names = [],
Expand Down
14 changes: 14 additions & 0 deletions templates/named.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ options {
bindkeys-file "/etc/named.iscdlv.key";
};

<% if @logging -%>
logging {
channel main_log {
file "/var/log/named/named.log" versions 3 size 5m;
Expand All @@ -112,7 +113,20 @@ logging {
category lame-servers {
null;
};
<% if @custom_logging and !@custom_logging.empty? -%>
<% @custom_logging.each do |log_type,log_hashes| -%>
<% log_hashes.each do |name,log_hash| -%>
<%= log_type %> <%= name %> {
<% log_hash.each do |key,val| -%>
<%= key %> <%= val %>;
<% end -%>
};
<% end -%>
<% end -%>
<% end -%>
};
<% end -%>

<% if [email protected]? -%>

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