Skip to content
Snippets Groups Projects
Commit 7e4609e6 authored by Thomas Schneider's avatar Thomas Schneider
Browse files

Allow configuring systemd-journald disk usage

parent 3e05012d
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
- name: restart rsyslogd - name: restart rsyslogd
service: name=rsyslog state=restarted service: name=rsyslog state=restarted
- name: restart systemd-journald
systemd: name=systemd-journald.service state=restarted
- name: configure journal directory - name: configure journal directory
command: systemd-tmpfiles --create --prefix /var/log/journal command: systemd-tmpfiles --create --prefix /var/log/journal
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
- syslog - syslog
- journal - journal
- name: ensure systemd journal is presistent - name: ensure systemd journal is persistent
file: file:
path: /var/log/journal path: /var/log/journal
state: directory state: directory
...@@ -48,6 +48,26 @@ ...@@ -48,6 +48,26 @@
tags: tags:
- syslog - syslog
- name: create systemd-journald config directory
file:
path: /etc/systemd/journald.conf.d
state: directory
mode: '0755'
tags:
- config
- syslog
- name: configure journal size limits
template:
src: size.conf.j2
dest: /etc/systemd/journald.conf.d/size.conf
mode: '0644'
notify: restart systemd-journald
tags:
- config
- syslog
- service
- name: ensure rsyslog is running and enabled - name: ensure rsyslog is running and enabled
service: service:
name: rsyslog name: rsyslog
......
[Journal]
{% if systemd_journald is defined %}
{% if systemd_journald.system_max_use is defined %}
SystemMaxUse={{ systemd_journald.system_max_use }}
{% endif %}
{% if systemd_journald.system_keep_free is defined %}
SystemKeepFree={{ systemd_journald.system_keep_free }}
{% endif %}
{% if systemd_journald.system_max_file_size is defined %}
SystemMaxFileSize={{ systemd_journald.system_max_file_size }}
{% endif %}
{% if systemd_journald.system_max_files is defined %}
SystemMaxFiles={{ systemd_journald.system_max_files }}
{% endif %}
{% endif %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment