role.lxc-rsyslog-no-kernel/tasks/main.yml

19 lines
364 B
YAML
Raw Normal View History

2021-12-13 09:12:40 +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
ansible.builtin.lineinfile:
2021-12-13 09:12:40 +00:00
path: /etc/rsyslog.conf
regexp: '^[\s#]*(.*imklog.*)$'
2021-12-13 09:12:40 +00:00
line: '#\1'
backrefs: true
2021-12-13 09:12:40 +00:00
backup: yes
when: rsyslogd_conf.stat.exists
2021-12-13 09:12:40 +00:00
notify: Restart Rsyslog