robertdebock / ansible-role-rsyslog

Install and configure rsyslog on your system.
https://robertdebock.nl/
Apache License 2.0
36 stars 40 forks source link

Add option to use modern configuration file format #8

Closed wzzrd closed 3 years ago

wzzrd commented 3 years ago

Previously, this role used the pre-v6 configuration file format, which is considered obsolete[1]. This change adds an option to use a template written in the advanced format introduced with rsyslog v6.

I have ported the configuration file previously shipped with this role to the default configuration file as shipped in Fedora 32. All options previously available are implemented in the new file, except for the FileCreateMode and DirCreateMode options. These have probably never worked with rsyslog installations managed through a systemd unit file anyway. The unit file for rsyslog (e.g. on Fedora) ships with a UMask setting, which makes FileCreateMode and DirCreateMode do things the unsuspecting user will, well, not expect :)

I have added a new configuration file template, renamed the old one, added an assert test, updated the README file, added a new variable called 'rsyslog_config_file_format' with a default value, and of course an updated task.

The default value for the new variable is 'legacy' in order to not change the configuration file of existing users out of the blue. Admins need to make the concious choice to move to the advanced format by switching rsyslog_config_file_format to 'advanced'.

Main reason for this change from my side is as follows. On my Fedora 32 servers, I'm noticing that with the old configuration file format, journald stops logging certain sshd events. I need those events for fail2ban. I'm not sure exactly what makes journald and rsyslog make a mess together. I am sure, however, that with the advanced format, they play together nicely, hence this change.

Maybe this helps someone with the same problem. If not, it still might help people move to the more modern advanced format for rsyslog.conf.

M

[1] https://www.rsyslog.com/doc/v8-stable/configuration/conf_formats.html


name: Pull request about: Describe the proposed change


Describe the change A clear and concise description of what the pull request is.

Testing In case a feature was added, how were tests performed?

robertdebock commented 3 years ago

Cool, ready to merge, thanks @wzzrd!