diff --git a/roles/common/handlers/main.yml b/roles/common/handlers/main.yml index 41faca2..144df69 100644 --- a/roles/common/handlers/main.yml +++ b/roles/common/handlers/main.yml @@ -1,4 +1,7 @@ --- +- name: Restart journald + service: name=systemd-journald state=restarted + - name: update-initramfs command: update-initramfs -u -k all diff --git a/roles/common/tasks/Debian.yml b/roles/common/tasks/Debian.yml index 3a27bd9..c82c6c0 100644 --- a/roles/common/tasks/Debian.yml +++ b/roles/common/tasks/Debian.yml @@ -55,3 +55,11 @@ path: /etc/pam.d/su regexp: '^.*auth\s+required\s+pam_wheel.so$' line: 'auth required pam_wheel.so' + +- name: Configure journald retention + lineinfile: + path: "/etc/systemd/journald.conf" + state: "present" + regexp: "^#?MaxRetentionSec=.*" + line: "MaxRetentionSec=7day" + notify: Restart journald