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 ================ 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 -%}