diff --git a/group_vars/all/main.yml b/group_vars/all/main.yml index 562864d6ee..a9bbfccbdf 100644 --- a/group_vars/all/main.yml +++ b/group_vars/all/main.yml @@ -7,6 +7,7 @@ php_version: "8.0" ntp_timezone: Etc/UTC ntp_manage_config: true www_root: /srv/www +max_journal_size: 512M # Values of raw_vars will be wrapped in `{% raw %}` to avoid templating problems if values include `{%` and `{{`. # Will recurse dicts/lists. `*` is wildcard for one or more dict keys, list indices, or strings. Example: diff --git a/roles/common/handlers/main.yml b/roles/common/handlers/main.yml index 8035cb64b4..0b98ca248d 100644 --- a/roles/common/handlers/main.yml +++ b/roles/common/handlers/main.yml @@ -12,4 +12,9 @@ name: php{{ php_version }}-fpm state: reloaded +- name: restart journald + service: + name: systemd-journald + state: restarted + - import_tasks: reload_nginx.yml diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 84ff7aa2fd..8b74eb1061 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -183,3 +183,13 @@ - name: Fail when unable to retrieve SSH client IP fail: msg: "External IP resolution failed. Check that your DNS servers are working. Try to disable DNSCrypt if you are using it." + +- name: Restrict journal log size + lineinfile: + backup: yes + dest: /etc/systemd/journald.conf + insertafter: "^[Journal]" + line: "SystemMaxUse={{ max_journal_size }}" + regexp: "^#?(SystemMaxUse=.*?)$" + state: present + notify: restart journald