Skip to content
Snippets Groups Projects
Commit 38a389c5 authored by Jörg Sachse's avatar Jörg Sachse
Browse files

feat: reduce max Journal size to 300MB and add handler to cleanup anything that is larger than that

parent ddcd79c6
No related branches found
No related tags found
No related merge requests found
Pipeline #5801 failed
...@@ -7,3 +7,5 @@ exim4_sendonly_username: '' ...@@ -7,3 +7,5 @@ exim4_sendonly_username: ''
exim4_sendonly_password: '' exim4_sendonly_password: ''
exim_name: "{{ 'exim4' if ansible_distribution == 'Debian' else 'exim' }}" exim_name: "{{ 'exim4' if ansible_distribution == 'Debian' else 'exim' }}"
journal_maxsize: "300M"
...@@ -57,6 +57,10 @@ ...@@ -57,6 +57,10 @@
name: "systemd-journald" name: "systemd-journald"
state: restarted state: restarted
- name: vacuum journal
ansible.builtin.command: journalctl --vacuum-size={{ journal_maxsize }}
changed_when: false
- name: restart logrotate.service - name: restart logrotate.service
ansible.builtin.systemd: ansible.builtin.systemd:
name: "logrotate.service" name: "logrotate.service"
......
...@@ -25,11 +25,12 @@ ...@@ -25,11 +25,12 @@
Compress=true Compress=true
# Controls how much disk space the journal may use up at most. (default: 10%) # Controls how much disk space the journal may use up at most. (default: 10%)
SystemMaxUse=1G SystemMaxUse={{ journal_maxsize }}
# Controls how much disk space systemd-journald shall leave free for other uses. (default: 15%) # Controls how much disk space systemd-journald shall leave free for other uses. (default: 15%)
# THIS DOES NOT WORK, HOWEVER: SystemKeepFree=15% # THIS DOES NOT WORK, HOWEVER: SystemKeepFree=15%
SystemKeepFree=350M SystemKeepFree=350M
notify: notify:
- reload journald configuration - reload journald configuration
- vacuum journal
when: ansible_facts.service_mgr == "systemd" when: ansible_facts.service_mgr == "systemd"
--- ---
journal_maxsize: "300M"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment