set max size for systemd journal

My /var/log/journal was 2.9GB. I'm not sure what a good limit is, but it
certainly is less than that...
This commit is contained in:
Pig Monkey 2016-12-17 19:15:25 -08:00
parent f2ae6451e8
commit 8da136c5db
4 changed files with 18 additions and 0 deletions

View file

@ -169,3 +169,6 @@ cryptshot:
interval: 6
- level: monthly
interval: 3
journal:
max_size: 500M

View file

@ -0,0 +1,11 @@
---
- name: Create journal config directory
file: path=/etc/systemd/journald.conf.d state=directory
tags:
- journal
- name: Push journal max size config
template: src=00-journal-size.conf.j2 dest=/etc/systemd/journald.conf.d/00-journal-size.conf.j2
when: journal is defined and journal.max_size is defined
tags:
- journal

View file

@ -13,3 +13,4 @@
- include: user.yml
- include: sudo.yml
- include: packages.yml
- include: journal.yml

View file

@ -0,0 +1,3 @@
# {{ ansible_managed }}
[Journal]
SystemMaxUse={{ journald.max_size }}