Bug 2039106

Summary: Logging role "logging_purge_confs" option not properly working
Product: Red Hat Enterprise Linux 9 Reporter: Noriko Hosoi <nhosoi>
Component: rhel-system-rolesAssignee: Rich Megginson <rmeggins>
Status: CLOSED ERRATA QA Contact: Jakub Haruda <jharuda>
Severity: unspecified Docs Contact: Gabi Fialová <gfialova>
Priority: unspecified    
Version: 9.0CC: djez, gfialova, jafiala, jharuda, nhosoi, rmeggins, spetrosi
Target Milestone: rcKeywords: Triaged
Target Release: 9.0Flags: gfialova: needinfo-
pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: role:logging
Fixed In Version: rhel-system-roles-1.12.0-1.el9 Doc Type: Bug Fix
Doc Text:
.The `logging_purge_confs` option correctly deletes unnecessary configuration files With the `logging_purge_confs` option set to `true`, it should delete unnecessary logging configuration files. Previously, however, unnecessary configuration files were not deleted from the configuration directory even if `logging_purge_confs` was set to `true`. This issue is now fixed and the option has been redefined as follows: if `logging_purge_confs` is set to `true`, Rsyslog removes files from the `rsyslog.d` directory which do not belong to any rpm packages. This includes configuration files generated by previous runs of the Logging role. The default value of `logging_purge_confs` is `false`.
Story Points: ---
Clone Of:
: 2039107 (view as bug list) Environment:
Last Closed: 2022-05-17 13:03:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1990985, 2039107    

Description Noriko Hosoi 2022-01-11 01:09:26 UTC
Description of problem:
When "logging_purge_confs: true" is set in the playbook as [0], if the cleanup task is executed as in [1], all the config files in /etc/rsyslog.d are wiped out.

Then the cleanup task tries to restart rsyslogd to fail with the broken configuration. 

[0]- https://github.com/linux-system-roles/logging/blob/master/tests/tests_basics_files.yml#L286
[1] - https://github.com/linux-system-roles/logging/blob/master/tests/tests_basics_files.yml#L387

To avoid the broken configuration problem, the logging role generates a backup file of /etc/rsyslog.conf and files in /etc/rsyslog.d prior to running the logging role and store it in /var/lib/rsyslog.

Then, if logging_restore_confs is set to true, the configuration files in the backup file are restored in /etc.

This is useful to reset the rsyslog configration as in [1].


To verify, run TEST CASE 3 in tests_basics_files.yml.
https://github.com/linux-system-roles/logging/blob/master/tests/tests_basics_files.yml#L282

Comment 1 Noriko Hosoi 2022-01-18 20:51:41 UTC
Note: this bz is a rhel-9 counterpart of Bug 2040812.

Comment 2 Noriko Hosoi 2022-01-18 21:32:55 UTC
*** Bug 1990971 has been marked as a duplicate of this bug. ***

Comment 18 errata-xmlrpc 2022-05-17 13:03:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: rhel-system-roles), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2443