Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support specifying no rsyslog_mods #11

Open
chancez opened this issue Nov 11, 2020 · 3 comments
Open

Support specifying no rsyslog_mods #11

chancez opened this issue Nov 11, 2020 · 3 comments

Comments

@chancez
Copy link
Contributor

chancez commented Nov 11, 2020

Proposed feature

Currently the assertions check if rsyslog_mods is defined/empty, and fails if it there isn't at least 1 module loaded. However, this validation seems unnecessary none of the allowed rsyslog_mods are strictly required.

I'm using rsyslog purely as a receiver of logs from other hosts to be forwarded to another log processing tool.

I'm using journald to provide /dev/log so I don't need immuxsock. I don't want to use imjournal because I don't want the host's journal logs to go to rsyslog. imklog and immark aren't really needed for me either.

I propose the validation on rsyslog_mods is either removed or changed to allow specifying an empty list.

@chancez
Copy link
Contributor Author

chancez commented Nov 11, 2020

Also, when immuxsocket isn't specified, you get this error:

invalid or yet-unknown config file command 'OmitLocalLogging'

because https://github.com/robertdebock/ansible-role-rsyslog/blob/master/templates/legacy_rsyslog.conf.j2#L40 is set when the module isnt loaded, but it's an option that only applies when that module is loaded.

@isuftin
Copy link

isuftin commented Mar 2, 2022

Seeing a similar issue when only including imjournal

Mar  2 16:32:16 vagrant-centos-7-vagrant-centos-7-stig systemd: Starting System Logging Service...
Mar  2 16:32:16 vagrant-centos-7-vagrant-centos-7-stig rsyslogd: [origin software="rsyslogd" swVersion="8.24.0-57.el7_9.1" x-pid="5699" x-info="http://www.rsyslog.com"] start
Mar  2 16:32:16 vagrant-centos-7-vagrant-centos-7-stig rsyslogd: invalid or yet-unknown config file command 'SystemLogSocketName' - have you forgotten to load a module? [v8.24.0-57.el7_9.1 try http://www.rsyslog.com/e/3003 ]
Mar  2 16:32:16 vagrant-centos-7-vagrant-centos-7-stig rsyslogd: invalid or yet-unknown config file command 'OmitLocalLogging' - have you forgotten to load a module? [v8.24.0-57.el7_9.1 try http://www.rsyslog.com/e/3003 ]
Mar  2 16:32:16 vagrant-centos-7-vagrant-centos-7-stig systemd: Started System Logging Service.

Everything still seems to work though

@isuftin
Copy link

isuftin commented Mar 2, 2022

@chancez - I know this issue is now years old but I was able to get around this in a hacky way...

rsyslog_rsyslog_d_files:
  # We have to do it this way because of:
  # https://github.com/robertdebock/ansible-role-rsyslog/issues/11
  # https://github.com/robertdebock/ansible-role-rsyslog/pull/12
  - omit_local_logging_fix:
      content: $OmitLocalLogging on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants