--- # An uncapped persistent journal can fill a small root disk. A drop-in caps it; the cap applies on # the next journald start, which the handler triggers. - name: Ensure the journald drop-in directory exists become: true ansible.builtin.file: path: /etc/systemd/journald.conf.d state: directory owner: root group: root mode: "0755" - name: Cap the size of the persistent journal become: true ansible.builtin.copy: dest: /etc/systemd/journald.conf.d/50-system-baseline.conf content: | # Managed by Ansible (role system_baseline). [Journal] SystemMaxUse={{ system_baseline_journal_max_use }} owner: root group: root mode: "0644" notify: Restart systemd-journald