Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set max journal log file size #1399

Merged
merged 1 commit into from
Jul 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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