Files
ansible-role-debian_common/tasks/edit-journald.yml

21 lines
735 B
YAML
Raw Normal View History

2024-10-26 16:23:45 +02:00
---
- 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 }
2025-12-09 10:36:48 +01:00
- { regexp: "^#?SystemMaxUse", line: SystemMaxUse=100M }
2024-10-26 16:23:45 +02:00
notify: Restart systemd-journald
# vars:
# ansible_remote_tmp: /tmp # Prevent warnings for auto-created tmp dir
2024-10-26 16:23:45 +02:00
# 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