role.systemd-journald-size/tasks/main.yml

31 lines
819 B
YAML
Raw Normal View History

2024-11-08 10:24:44 +00:00
---
- name: Check if systemd-journald is running
service_facts:
ignore_errors: true
register: systemd_journald_services
- name: '[BLOCK] When systemd-journald is running...'
when: systemd_journald_services is succeeded and "systemd-journald.service" in ansible_facts.services
block:
- name: Create /etc/systemd/journald.conf.d
file:
path: /etc/systemd/journald.conf.d
state: directory
owner: root
group: root
mode: 0755
- name: Template /etc/systemd/journald.conf.d/SystemMaxUse.conf
template:
src: SystemMaxUse.conf.j2
dest: /etc/systemd/journald.conf.d/SystemMaxUse.conf
owner: root
group: root
mode: 0755
backup: true
notify:
- Restart systemd-journald
- Vaccuum journald