Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
chore: Update systemd journal configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
nadeemshahzad committed Apr 17, 2024
1 parent de05b92 commit dea2ba1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions playbooks/roles/vhost/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,17 @@
when: COMMON_OBJECT_STORE_LOG_SYNC
and not (ansible_distribution_release == 'precise' or ansible_distribution_release == 'trusty')

- name: Set maximum disk space usage for systemd journal
- name: Set maximum disk space usage, free space, retention, and file age for systemd journal
lineinfile:
path: /etc/systemd/journald.conf
regexp: '^#?SystemMaxUse='
line: 'SystemMaxUse=1G'
regexp: '^#?{{ item.regexp }}'
line: '{{ item.line }}'
state: present
with_items:
- { regexp: 'SystemMaxUse=', line: 'SystemMaxUse=500M' }
- { regexp: 'SystemKeepFree=', line: 'SystemKeepFree=1G' }
- { regexp: 'MaxRetentionSec=', line: 'MaxRetentionSec=1month' }
- { regexp: 'MaxFileSec=', line: 'MaxFileSec=1week' }
register: journald_config_line
when: ansible_distribution_release == 'bionic' or ansible_distribution_release == 'focal'

Expand Down

0 comments on commit dea2ba1

Please sign in to comment.