Initial commit
This commit is contained in:
18
tasks/edit-journald.yml
Normal file
18
tasks/edit-journald.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
- name: Edit journald.conf
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/systemd/journald.conf
|
||||
regexp: "{{ item.regexp }}"
|
||||
line: "{{ item.line }}"
|
||||
state: "{{ item.state | default('present') }}"
|
||||
with_items:
|
||||
- { regexp: "^#?Storage", line: Storage=volatile }
|
||||
- { regexp: "^#?ForwardToSyslog", line: ForwardToSyslog=no }
|
||||
- { regexp: "^#?SystemMaxUse", line: SystemMaxUse=50M }
|
||||
notify: Restart systemd-journald
|
||||
|
||||
# A succesful vacuum does impact log size, but is not considered a change
|
||||
- name: Vacuum journalctl before
|
||||
ansible.builtin.command: journalctl --vacuum-size=10M
|
||||
register: vacuumresult
|
||||
changed_when: false
|
||||
Reference in New Issue
Block a user