2021-12-13 09:12:40 +00:00
|
|
|
---
|
2024-07-09 21:52:55 +00:00
|
|
|
- name: Check if /etc/rsyslogd.conf exists
|
|
|
|
ansible.builtin.stat:
|
|
|
|
path: /etc/rsyslog.conf
|
|
|
|
register: rsyslogd_conf
|
|
|
|
|
|
|
|
|
2021-12-13 09:12:40 +00:00
|
|
|
- name: Disable kernel logging
|
2024-07-09 21:52:55 +00:00
|
|
|
ansible.builtin.lineinfile:
|
2021-12-13 09:12:40 +00:00
|
|
|
path: /etc/rsyslog.conf
|
2024-07-09 21:52:55 +00:00
|
|
|
regexp: '^[\s#]*(.*imklog.*)$'
|
2021-12-13 09:12:40 +00:00
|
|
|
line: '#\1'
|
2024-07-09 21:52:55 +00:00
|
|
|
backrefs: true
|
2021-12-13 09:12:40 +00:00
|
|
|
backup: yes
|
2024-07-09 21:52:55 +00:00
|
|
|
when: rsyslogd_conf.stat.exists
|
2021-12-13 09:12:40 +00:00
|
|
|
notify: Restart Rsyslog
|
|
|
|
|
2024-07-09 21:52:55 +00:00
|
|
|
|