Cap the systemd journal at 512M on disk, 128M in memory and two weeks in the common role

This commit is contained in:
2026-10-09 12:53:44 +00:00
parent fd73949412
commit b62992f21e
4 changed files with 31 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
- name: Cap the journal size
when: journald_size_cap | default(none) is not none
block:
- name: Create the journald drop-in directory
file:
path: /etc/systemd/journald.conf.d
state: directory
- name: Set the journal size cap
copy:
dest: /etc/systemd/journald.conf.d/10-size-cap.conf
content: |
[Journal]
{% for key, value in journald_size_cap.items() %}
{{ key }}={{ value }}
{% endfor %}
notify: restart_journald
+3
View File
@@ -11,3 +11,6 @@
- import_tasks: ./networking.yml
- import_tasks: ./disk_maintenance.yml
- import_tasks: ./journald.yml
tags: journald