From ee7471e6e43ed972271bd4b38cd25235c4e137c3 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Tue, 30 Aug 2022 17:18:15 +0200 Subject: [PATCH] Configure unattended-upgrades --- machine.yml | 20 +++++++++++++++++++ root/etc/apt/apt.conf.d/50unattended-upgrades | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/machine.yml b/machine.yml index c3403ec..e8e8fd0 100644 --- a/machine.yml +++ b/machine.yml @@ -6,6 +6,26 @@ tasks: + # ------------------------------------------------------------------------- + # Unattended upgrades configuration. + # ------------------------------------------------------------------------- + + - name: Install unattended-upgrades + apt: + name: unattended-upgrades + + - name: Configure unattended-upgrades + copy: + src: ./root/etc/apt/apt.conf.d/50unattended-upgrades + dest: /etc/apt/apt.conf.d/50unattended-upgrades + mode: 0644 + + - name: Enable unattended-upgrades + copy: + src: ./root/etc/apt/apt.conf.d/20auto-upgrades + dest: /etc/apt/apt.conf.d/20auto-upgrades + mode: 0644 + # ---------------------------------------------------------------------------------------------- # SSH configuration. # ---------------------------------------------------------------------------------------------- diff --git a/root/etc/apt/apt.conf.d/50unattended-upgrades b/root/etc/apt/apt.conf.d/50unattended-upgrades index 7fbd3d4..69ad7b6 100644 --- a/root/etc/apt/apt.conf.d/50unattended-upgrades +++ b/root/etc/apt/apt.conf.d/50unattended-upgrades @@ -91,7 +91,7 @@ Unattended-Upgrade::Package-Blacklist { // If empty or unset then no email is sent, make sure that you // have a working mail setup on your system. A package that provides // 'mailx' must be installed. E.g. "user@example.com" -//Unattended-Upgrade::Mail ""; +Unattended-Upgrade::Mail "root"; // Set this value to one of: // "always", "only-on-error" or "on-change"