Commit 5f7dc225 authored by Tim Smith's avatar Tim Smith Committed by GitHub
Browse files

Merge pull request #124 from rmcleod8/directive_tweaks

CH-#123 - RSYSLOG COOKBOOK :: Extending Attributes in lieu of hardcoded values
parents 1f826803 b07898ef
......@@ -38,6 +38,11 @@ See `attributes/default.rb` for default values.
- `node['rsyslog']['max_message_size']` - Specify the maximum allowed message size. Default is 2k.
- `node['rsyslog']['user']` - Who should own the configuration files and directories
- `node['rsyslog']['group']` - Who should group-own the configuration files and directories
- `node['rsyslog']['dir_owner']` - Who should own the log directories
- `node['rsyslog']['dir_group']` - Who should group-own the log directories
- `node['rsyslog']['file_create_mode']` - Mode that should be set when creating log files
- `node['rsyslog']['dir_create_mode']` - Mode that should be set when creating log directories
- `node['rsyslog']['umask']` - Specify the processes umask
- `node['rsyslog']['defaults_file']` - The full path to the defaults/sysconfig file for the service.
- `node['rsyslog']['service_name']` - The platform-specific name of the service
- `node['rsyslog']['preserve_fqdn']` - Value of the `$PreserveFQDN` configuration directive in `/etc/rsyslog.conf`. Default is 'off' for compatibility purposes.
......@@ -48,6 +53,7 @@ See `attributes/default.rb` for default values.
- `node['rsyslog']['default_facility_logs']` - Hash containing log facilities and destinations used in `50-default.conf` template.
- `node['rsyslog']['default_file_template']` - The name of a pre-defined log format template (ie - RSYSLOG_FileFormat), used for local log files.
- `node['rsyslog']['default_remote_template']` - The name of a pre-defined log format template (ie - RSYSLOG_FileFormat), used for sending to remote servers.
- `node['rsyslog']['templates']` - Allows a user to specify a dynamic filename and the format of the logs
- `node['rsyslog']['rate_limit_interval']` - Value of the $SystemLogRateLimitInterval configuration directive in `/etc/rsyslog.conf`. Default is nil, leaving it to the platform default.
- `node['rsyslog']['rate_limit_burst']` - Value of the $SystemLogRateLimitBurst configuration directive in `/etc/rsyslog.conf`. Default is nil, leaving it to the platform default.
- `node['rsyslog']['action_queue_max_disk_space']` - Max amount of disk space the disk-assisted queue is allowed to use ([more info](http://www.rsyslog.com/doc/queues.html)).
......
......@@ -52,7 +52,8 @@ default['rsyslog']['tls_permitted_peer'] = nil
default['rsyslog']['use_local_ipv4'] = false
default['rsyslog']['allow_non_local'] = false
default['rsyslog']['custom_remote'] = []
default['rsyslog']['additional_directives'] = {}
default['rsyslog']['additional_directives'] = {}
default['rsyslog']['templates'] = %w()
# The most likely platform-specific attributes
default['rsyslog']['service_name'] = 'rsyslog'
......@@ -62,6 +63,11 @@ default['rsyslog']['priv_seperation'] = false
default['rsyslog']['priv_user'] = nil
default['rsyslog']['priv_group'] = nil
default['rsyslog']['modules'] = %w(imuxsock imklog)
default['rsyslog']['file_create_mode'] = '0640'
default['rsyslog']['dir_create_mode'] = '0755'
default['rsyslog']['umask'] = '0022'
default['rsyslog']['dir_owner'] = 'root'
default['rsyslog']['dir_group'] = 'adm'
# platform specific attributes
case node['platform']
......
......@@ -4,7 +4,7 @@ maintainer_email 'cookbooks@chef.io'
license 'Apache 2.0'
description 'Installs and configures rsyslog'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '5.0.1'
version '5.0.2'
recipe 'rsyslog', 'Sets up rsyslog for local logging'
recipe 'rsyslog::client', 'Sets up a client to log to a remote rsyslog server'
......
......@@ -76,6 +76,14 @@ $ActionFileDefaultTemplate <%= node["rsyslog"]["default_file_template"] %>
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
<% end -%>
<% if node['rsyslog']['templates'] && !node['rsyslog']['templates'].empty? -%>
<% [*node['rsyslog']['templates']].each do |template| %>
#
# Additional Log templates
#
$Template <%= template %>
<% end %>
<% end %>
# Filter duplicated messages
$RepeatedMsgReduction <%= node['rsyslog']['repeated_msg_reduction'] %>
......@@ -87,11 +95,14 @@ $WorkDirectory <%= node['rsyslog']['working_dir'] %>
#
# Set the default permissions for all log files.
#
$Umask <%= node['rsyslog']['umask'] %>
$FileOwner <%= node['rsyslog']['user'] %>
$FileGroup <%= node['rsyslog']['group'] %>
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
$FileCreateMode <%= node['rsyslog']['file_create_mode'] %>
$DirOwner <%= node['rsyslog']['dir_owner'] %>
$DirGroup <%= node['rsyslog']['dir_group'] %>
$DirCreateMode <%= node['rsyslog']['dir_create_mode'] %>
<% if node['rsyslog']['priv_seperation'] %>
$PrivDropToUser <%= node['rsyslog']['priv_user'] || node['rsyslog']['user'] %>
$PrivDropToGroup <%= node['rsyslog']['priv_group'] || node['rsyslog']['group'] %>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment