Optional creation of default configuration file 50-default.conf

- Added a boolean attribute node['rsyslog']['default_conf_file']
  which is by default true.
- When node['rsyslog']['default_conf_file'] is false, the default
  configuration file 50-default.conf is not created, otherwise the
  behaviour is unchanged.
Signed-off-by: default avatarJean-Francois Weber-Marx <jfwm@hotmail.com>
parent a76563e7
......@@ -73,6 +73,7 @@ See `attributes/default.rb` for default values.
- `node['rsyslog']['custom_remote']` - Array of hashes for configuring custom remote server targets
- `node['rsyslog']['additional_directives']` - Hash of additional directives and their values to place in the main rsyslog config file
- `node['rsyslog']['local_host_name']` - permits to overwrite the system hostname with the one specified in the directive
- `node['rsyslog']['default_conf_file']` - If false it skips the creation of default configuration file 50-default.conf
## Recipes
......
......@@ -54,6 +54,7 @@ default['rsyslog']['allow_non_local'] = false
default['rsyslog']['custom_remote'] = []
default['rsyslog']['additional_directives'] = {}
default['rsyslog']['templates'] = %w()
default['rsyslog']['default_conf_file'] = true
# The most likely platform-specific attributes
default['rsyslog']['package_name'] = 'rsyslog'
......
......@@ -60,7 +60,7 @@ template "#{node['rsyslog']['config_prefix']}/rsyslog.d/50-default.conf" do
mode '0644'
notifies :run, 'execute[validate_config]'
notifies :restart, "service[#{node['rsyslog']['service_name']}]"
end
end unless node['rsyslog']['default_conf_file'] == false
# syslog needs to be stopped before rsyslog can be started on RHEL versions before 6.0
if platform_family?('rhel') && node['platform_version'].to_i < 6
......
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