Skip to content

Commit

Permalink
Set max journal log file size
Browse files Browse the repository at this point in the history
  • Loading branch information
robrecord committed Jul 1, 2022
1 parent e497cfe commit 1405ea2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions group_vars/all/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions roles/common/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 lournal log size
lineinfile:
backup: yes
dest: /etc/systemd/journald.conf
insertafter: "^[Journal]"
line: "SystemMaxUse={{ max_journal_size }}"
regexp: "^#?(SystemMaxUse=.*?)$"
state: present
notify: restart journald

0 comments on commit 1405ea2

Please sign in to comment.