From 9a65312190e695dfcbdbc1ae95ca74f3a8a3bfc1 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Thu, 18 Apr 2024 15:10:01 +0200 Subject: [PATCH] evolinux-base: disable logcheck monitoring of journald only if journald.logfiles exists --- CHANGELOG.md | 1 + evolinux-base/tasks/logs.yml | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dff2c1c..78d41498 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The **patch** part is incremented if multiple releases happen the same month * autosysadmin-agent: upstream release 24.03.2 * evolinux-base: Add new variable to disable global customisation of bash config +* evolinux-base: Disable logcheck monitoring of journald only if journald.logfiles exists * roundcube: Use /var/log/roundcube directly * evolinux-users: Add sudo mvcli for nagios user * vrrpd : configure and restart minifirewall before starting VRRP diff --git a/evolinux-base/tasks/logs.yml b/evolinux-base/tasks/logs.yml index b8838c9e..ce796d6c 100644 --- a/evolinux-base/tasks/logs.yml +++ b/evolinux-base/tasks/logs.yml @@ -64,12 +64,19 @@ when: evolinux_logs_default_dateext | bool # Logcheck +- name: Check if journald.logfiles exists + stat: + path: /etc/logcheck/logcheck.logfiles.d/journal.logfiles + register: _logcheck_journald_logfiles + - name: Disable logcheck monitoring of journald ansible.builtin.lineinfile: dest: /etc/logcheck/logcheck.logfiles.d/journal.logfiles line: "#journal" regexp: "^journal" - when: evolinux_logs_disable_logcheck_journald | bool + when: + - _logcheck_journald_logfiles.stat.exists + - evolinux_logs_disable_logcheck_journald | bool # Journald - name: /etc/systemd/journald.conf.d/ is present