First version

This commit is contained in:
Sven Velt 2021-12-13 10:12:40 +01:00
parent 759f18def9
commit 025d57b3b9
3 changed files with 38 additions and 1 deletions

View file

@ -1,3 +1,25 @@
# lxc_rsyslog_no_kernel # lxc_rsyslog_no_kernel
No kernel logging in LXContainers No kernel logging in LXContainers
## Example playbook:
```
- hosts: all
roles:
- role: lxc_rsyslog_no_kernel
when: ansible_virtualization_role|default('NA') == 'guest' and ansible_virtualization_type|default('NA') == 'lxc'
```
## License
GPL-3.0-or-later
## Author Information
- Sven Velt <sven-ansiblerole@velt.biz>
- https://git.velt.biz/velt.biz/

6
handlers/main.yml Normal file
View file

@ -0,0 +1,6 @@
---
- name: Restart Rsyslog
service:
name: rsyslog
state: restarted

9
tasks/main.yml Normal file
View file

@ -0,0 +1,9 @@
---
- name: Disable kernel logging
lineinfile:
path: /etc/rsyslog.conf
regexp: '^\s+#?(.*imklog.)$'
line: '#\1'
backup: yes
notify: Restart Rsyslog