Commit 0e3b3ce1 authored by Tim Smith's avatar Tim Smith
Browse files

Add 'additional_directives' attribute with a hash of configs. Use this to add...

Add 'additional_directives' attribute with a hash of configs.  Use this to add directives for systemd based systems
parent a47ec7b6
......@@ -53,6 +53,7 @@ See `attributes/default.rb` for default values.
* `node['rsyslog']['tls_key_file']` - Path to TLS key file. Required for server, optional for clients.
* `node['rsyslog']['tls_auth_mode']` - Value for `$InputTCPServerStreamDriverAuthMode`/`$ActionSendStreamDriverAuthMode`, determines whether client certs are validated. Defaults to `anon` (no validation).
* `node['rsyslog']['use_local_ipv4']` - Whether or not to make use the remote local IPv4 address on cloud systems when searching for servers (where available). Default is 'false'.
* `node['rsyslog']['additional_directives']` - Hash of additional directives and their values to place in the main rsyslog config file
Recipes
-------
......
......@@ -47,6 +47,7 @@ default['rsyslog']['tls_certificate_file'] = nil
default['rsyslog']['tls_key_file'] = nil
default['rsyslog']['tls_auth_mode'] = 'anon'
default['rsyslog']['use_local_ipv4'] = false
default['rsyslog']['additional_directives'] = {}
# The most likely platform-specific attributes
default['rsyslog']['service_name'] = 'rsyslog'
......@@ -70,7 +71,10 @@ when 'rhel', 'fedora'
'local7.*' => "#{node['rsyslog']['default_log_dir']}/boot.log"
}
# RHEL >= 7 and Fedora >= 19 use journald in systemd
default['rsyslog']['modules'] = %w(imuxsock imjournal) if node['platform_version'].to_i == 7 || node['platform_version'].to_i >= 19
if node['platform_version'].to_i == 7 || node['platform_version'].to_i >= 19
default['rsyslog']['modules'] = %w(imuxsock imjournal)
default['rsyslog']['additional_directives'] = { 'OmitLocalLogging' => 'on', 'IMJournalStateFile' => 'imjournal.state' }
end
else
# format { facility => destination }
default['rsyslog']['default_facility_logs'] = {
......
......@@ -101,3 +101,6 @@ $SystemLogRateLimitBurst <%= node['rsyslog']['rate_limit_burst'] %>
# Include all config files in <%= node['rsyslog']['config_prefix'] %>/rsyslog.d/
#
$IncludeConfig <%= node['rsyslog']['config_prefix'] %>/rsyslog.d/*.conf
<% node['rsyslog']['additional_directives'].each_pair do |k,v| %>
$<%= k %> <%= v %>
<% end %>
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