diff --git a/.rubocop.yml b/.rubocop.yml index b7c7a1edcc57e44ff7a468dfc03ef3687c328d05..b9a7daec43cfd52a58cbacf261f9a7755a470094 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,9 +5,6 @@ Lint/AmbiguousRegexpLiteral: Exclude: - 'test/**/*' -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes. -# SupportedStyles: slashes, percent_r, mixed Style/RegexpLiteral: Exclude: - 'test/**/*' diff --git a/attributes/default.rb b/attributes/default.rb index 80f2393a7a6ee3de6d39db6148899bff2c588af9..f93388d58d5a432a39096d8ef3f415f63127f641 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -96,6 +96,7 @@ case node['platform_family'] when 'suse' default['rsyslog']['service_name'] = 'syslog' default['rsyslog']['group'] = 'root' + default['rsyslog']['dir_group'] = 'trusted' default['rsyslog']['default_facility_logs'] = { '*.emerg' => ':omusrmsg:*', 'mail.*' => "-#{node['rsyslog']['default_log_dir']}/mail.log", @@ -113,7 +114,7 @@ when 'suse' 'local4.*;local5.*' => "-#{node['rsyslog']['default_log_dir']}/localmessages", 'local6.*;local7.*' => "-#{node['rsyslog']['default_log_dir']}/localmessages", } -when 'rhel', 'fedora' +when 'rhel', 'fedora', 'amazon' default['rsyslog']['working_dir'] = '/var/lib/rsyslog' # format { facility => destination } default['rsyslog']['default_facility_logs'] = { @@ -125,8 +126,8 @@ when 'rhel', 'fedora' 'uucp,news.crit' => "#{node['rsyslog']['default_log_dir']}/spooler", 'local7.*' => "#{node['rsyslog']['default_log_dir']}/boot.log", } - # RHEL >= 7 and Fedora use journald in systemd. Amazon Linux doesn't. - if node['platform'] != 'amazon' && node['platform_version'].to_i >= 7 + # journald is used in systemd + if node['init_package'] != 'systemd' default['rsyslog']['modules'] = %w(imuxsock imjournal) default['rsyslog']['additional_directives'] = { 'OmitLocalLogging' => 'on', 'IMJournalStateFile' => 'imjournal.state' } end @@ -150,8 +151,3 @@ else '*.emerg' => ':omusrmsg:*', } end - -# rsyslog 3/4 do not support the new :omusrmsg:* format and need * instead -if platform_family?('rhel') && node['platform_version'].to_i < 6 - default['rsyslog']['default_facility_logs']['*.emerg'] = '*' -end diff --git a/kitchen.yml b/kitchen.yml index 3f4ce77d0db1de814975150a7e37da4871541c52..e3bd27ec48138b75544fd67e1238fa9c89311c0b 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -16,7 +16,7 @@ platforms: - name: centos-8 - name: debian-9 - name: debian-10 - - name: fedora-29 + - name: fedora-31 - name: opensuse-leap-15 - name: ubuntu-16.04 - name: ubuntu-18.04 diff --git a/metadata.rb b/metadata.rb index 1a17f4e4b5f4695188c16deb8471ff9ab407b723..43e8545b4d907a42af4f3c40c9cc242660ab4967 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,7 +5,7 @@ license 'Apache-2.0' description 'Installs and configures rsyslog' version '6.0.7' -%w(ubuntu debian mint redhat centos amazon scientific oracle fedora zlinux).each do |os| +%w(ubuntu debian linuxmint redhat centos amazon scientific oracle fedora zlinux).each do |os| supports os end