From cce64159ed0a15cd4ca0051a9474f1404ce2e8a2 Mon Sep 17 00:00:00 2001 From: pyllyukko Date: Sun, 23 Feb 2025 23:21:26 +0200 Subject: [PATCH] Configure alert_email into /etc/logcheck/logcheck.conf --- tasks/debian_packages.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tasks/debian_packages.yml b/tasks/debian_packages.yml index 685fb99b..fcc9610c 100644 --- a/tasks/debian_packages.yml +++ b/tasks/debian_packages.yml @@ -298,6 +298,22 @@ - result.failed - result.msg != "Destination /etc/apt/listchanges.conf does not exist!" +- name: Configure SENDMAILTO in /etc/logcheck/logcheck.conf + become: true + tags: + - debian + - configuration + ansible.builtin.replace: + path: /etc/logcheck/logcheck.conf + regexp: '^(SENDMAILTO=).+$' + replace: '\g<1>"{{ alert_email }}"' + validate: '/bin/grep "^SENDMAILTO=\"{{ alert_email }}\"$" %s' + backup: true + register: result + failed_when: + - result.failed + - result.msg != "Path /etc/logcheck/logcheck.conf does not exist !" + # https://www.whonix.org/wiki/Packages_for_Debian_Hosts # https://www.kicksecure.com/wiki/Packages_for_Debian_Hosts#Supported_Packages # https://www.kicksecure.com/wiki/Linux_Kernel_Runtime_Guard_LKRG