diff --git a/playbook-system.yml b/playbook-system.yml index cb3283c..1b5f1a8 100644 --- a/playbook-system.yml +++ b/playbook-system.yml @@ -36,6 +36,27 @@ security_autoupdate_enabled: true security_fail2ban_enabled: true + - name: "Create systemd journald drop-in directory" + ansible.builtin.file: + path: /etc/systemd/journald.conf.d + state: directory + owner: root + group: root + mode: "0755" + + - name: "Limit systemd journal size" + ansible.builtin.copy: + content: | + # Managed by ansible (playbook-system.yml) + # Без потолка journald занимает до 10% ФС. + [Journal] + SystemMaxUse=500M + dest: /etc/systemd/journald.conf.d/99-max-use.conf + owner: root + group: root + mode: "0644" + notify: "Restart systemd-journald" + - name: "Copy keep files script" ansible.builtin.copy: src: "files/keep-files.py" @@ -61,3 +82,9 @@ when: mount_external_storage | default(false) | bool tags: - mount-storage + + handlers: + - name: "Restart systemd-journald" + ansible.builtin.systemd_service: + name: systemd-journald + state: restarted