diff --git a/roles/rsyslog/defaults/main.yaml b/roles/rsyslog/defaults/main.yaml index 6237c78..ca72da2 100644 --- a/roles/rsyslog/defaults/main.yaml +++ b/roles/rsyslog/defaults/main.yaml @@ -17,6 +17,8 @@ rsyslog_load_modules: - name: imklog params: permitnonkernelfacility: "on" + - name: imtcp + - name: imudp rsyslog_work_directory: /var/spool/rsyslog rsyslog_include_config: /etc/rsyslog.d/*.conf diff --git a/roles/rsyslog/templates/rsyslog.conf.j2 b/roles/rsyslog/templates/rsyslog.conf.j2 index e432c08..5e8699c 100644 --- a/roles/rsyslog/templates/rsyslog.conf.j2 +++ b/roles/rsyslog/templates/rsyslog.conf.j2 @@ -13,6 +13,32 @@ module( {% endif %} {% endfor %} +{% for input in rsyslog_inputs | default([]) %} +{% if input.enabled | default(true) %} +input( + type="{{ input.name }}" +{% if input.params is defined and input.params is mapping %} +{% for k, v in input.params.items() | default({}) %} + {{ k }}="{{ v }}" +{% endfor %} +{% endif %} +) +{% endif %} +{% endfor %} + +{% for output in rsyslog_outputs | default([]) %} +{% if output.enabled | default(true) %} +action( + type="{{ output.name }}" +{% if output.params is defined and output.params is mapping %} +{% for k, v in output.params.items() | default({}) %} + {{ k }}="{{ v }}" +{% endfor %} +{% endif %} +) +{% endif %} +{% endfor %} + {% if rsyslog_action_file_default_template is defined %} $ActionFileDefaultTemplate {{ rsyslog_action_file_default_template }} {% endif %}