robertdebock / ansible-role-rsyslog

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

Support passing extra parameters to `omfwd` #45

Open tobiasmcnulty opened 1 year ago

tobiasmcnulty commented 1 year ago

Proposed feature

Allow passing custom parameters to omfwd, for example, for TLS configuration.

Rationale

This feature is needed to allow customizing the client setup for omfwd: https://www.rsyslog.com/doc/master/tutorials/tls.html#client-setup

Additional context

A hack/workaround is as follows:

rsyslog_remote_extra_params: >-
  StreamDriver="gtls"
  StreamDriverMode="1"
  StreamDriverAuthMode="x509/certvalid"
# Hack: This role doesn't support passing custom parameters to omfwd, so we
# inject them via rsyslog_remote (including removing the trailing '"', which
# is added back by the template in the role:
# https://github.com/robertdebock/ansible-role-rsyslog/blob/fdee66ebfe1514729c0548051895240757f43e19/templates/advanced_rsyslog.conf.j2#L108
rsyslog_remote: 'log.example.com" {{ rsyslog_remote_extra_params[:-1] }}'

Please consider sponsoring me.