Check for rsyslog.conf, update to regex
This commit is contained in:
parent
dacda31dd7
commit
e15c91e45d
|
@ -1,9 +1,18 @@
|
|||
---
|
||||
- name: Disable kernel logging
|
||||
lineinfile:
|
||||
- name: Check if /etc/rsyslogd.conf exists
|
||||
ansible.builtin.stat:
|
||||
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'
|
||||
backrefs: true
|
||||
backup: yes
|
||||
when: rsyslogd_conf.stat.exists
|
||||
notify: Restart Rsyslog
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue