You've already forked ansible-role-rsyslog
Add support to purge existing configuration snippets, by default don't purge anything.
This commit is contained in:
@@ -30,6 +30,7 @@ and configuration can be overridden, for additional informations please have a l
|
||||
|
||||
|
||||
**rsyslog_default_config**: Setup a default basic configuration stanza (default: "True")
|
||||
**purge_config**: Purge existing config snippets (default: "False")
|
||||
|
||||
|
||||
Dependencies
|
||||
|
||||
@@ -11,6 +11,7 @@ rsyslog_action_file_default_template: RSYSLOG_TraditionalFileFormat
|
||||
#rsyslog_action_file_template: "%rawmsg%\n"
|
||||
#rsyslog_priv_drop_to_user: syslog
|
||||
#rsyslog_priv_drop_to_group: syslog
|
||||
purge_config: False
|
||||
items: []
|
||||
rsyslog_default_config: "True"
|
||||
rsyslog_os_supported: no
|
||||
|
||||
@@ -35,6 +35,15 @@
|
||||
- restart rsyslog
|
||||
when: rsyslog_os_supported == True
|
||||
|
||||
- name: remove existing (custom/additional) configurations
|
||||
tags:
|
||||
- rsyslog
|
||||
- files
|
||||
file:
|
||||
state: absent
|
||||
path: "{{ rsyslog_include_path }}/"
|
||||
when: purge_config == True
|
||||
|
||||
- name: create additional configuration directory
|
||||
tags:
|
||||
- rsyslog
|
||||
|
||||
21
test.yml
Normal file
21
test.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
- name: Test playbook
|
||||
remote_user: root
|
||||
hosts: all
|
||||
vars:
|
||||
|
||||
handlers:
|
||||
|
||||
roles:
|
||||
- role: ../../xdrum.rsyslog
|
||||
rsyslog_default_config: True
|
||||
purge_config: True
|
||||
items:
|
||||
- name: "20-iptables"
|
||||
lines:
|
||||
- ':msg, contains, "iptables" /var/log/iptables.log'
|
||||
- '& ~'
|
||||
- name: "30-dovecot"
|
||||
lines:
|
||||
- 'if $programname == "dovecot" and $syslogseverity <= "6" then ~'
|
||||
- '& ~'
|
||||
Reference in New Issue
Block a user