From d60f8b092e7a8c8a55af4b426c5757323e8bcd3b Mon Sep 17 00:00:00 2001 From: James Shewey Date: Mon, 6 Nov 2017 16:34:32 -0700 Subject: [PATCH 1/2] Add support for RainerScript module configuration --- README.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.rst b/README.rst index 6bff252..698e470 100644 --- a/README.rst +++ b/README.rst @@ -70,6 +70,30 @@ Rsyslog service with precise timestamps, severity, facility. createmode: 0640 umask: 0022 stop_processing: true + +RainerScript Support for module configuration +============================================= + +In addition to support for the legacy format, `modules `_ can be configured using the `RainerScript `_ format. + +.. code-block:: yaml + + rsyslog: + client: + enabled: true + rainerscript: + imjournal: + PersistStateInterval: 200 + StateFile: /run/systemd/journal/rsyslog + IgnorePreviousMessages: on + output + file: + -/var/log/syslog: + filter: *.*;auth,authpriv.none + owner: syslog + group: adm + createmode: 0640 + umask: 0022 Custom templates ================ From 9454a3a9df599ec91b1d9be5d8395114d8329bd4 Mon Sep 17 00:00:00 2001 From: James Shewey Date: Mon, 6 Nov 2017 16:36:44 -0700 Subject: [PATCH 2/2] Add support for RainerScript style module configuration --- rsyslog/files/rsyslog.default.conf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rsyslog/files/rsyslog.default.conf b/rsyslog/files/rsyslog.default.conf index ff7f917..4afd2c9 100644 --- a/rsyslog/files/rsyslog.default.conf +++ b/rsyslog/files/rsyslog.default.conf @@ -3,6 +3,18 @@ {% for modname in global.modules -%} $ModLoad {{ modname }} {% endfor -%} + +{%- if global.rainerscript is defined %} + {%- for module_name, config_opts in global.rainerscript.iteritems() %} + +module(load"{{ module_name }}" + {%- for option, setting in config_opts.iteritems() %} + {{ option }}="{{ setting }}" + {%- endfor %} + ) + {%- endfor %} +{%- endif %} + {% if global.preserve_fqdn == true -%} $PreserveFQDN on {% else -%}