Check for rsyslog.conf, update to regex
This commit is contained in:
parent
dacda31dd7
commit
e15c91e45d
|
@ -1,9 +1,18 @@
|
||||||
---
|
---
|
||||||
- name: Disable kernel logging
|
- name: Check if /etc/rsyslogd.conf exists
|
||||||
lineinfile:
|
ansible.builtin.stat:
|
||||||
path: /etc/rsyslog.conf
|
path: /etc/rsyslog.conf
|
||||||
regexp: '^\s+#?(.*imklog.)$'
|
register: rsyslogd_conf
|
||||||
|
|
||||||
|
|
||||||
|
- name: Disable kernel logging
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: /etc/rsyslog.conf
|
||||||
|
regexp: '^[\s#]*(.*imklog.*)$'
|
||||||
line: '#\1'
|
line: '#\1'
|
||||||
|
backrefs: true
|
||||||
backup: yes
|
backup: yes
|
||||||
|
when: rsyslogd_conf.stat.exists
|
||||||
notify: Restart Rsyslog
|
notify: Restart Rsyslog
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue