From c5ac6713546a01c4b4a37823bb1e8e66e6a0742e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Wed, 29 May 2024 22:48:16 +0000 Subject: [PATCH] ensure unattended-upgrades are installed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- tasks/automatic_updates.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tasks/automatic_updates.yml b/tasks/automatic_updates.yml index 59eee052..79d78263 100644 --- a/tasks/automatic_updates.yml +++ b/tasks/automatic_updates.yml @@ -47,6 +47,15 @@ when: - ansible_os_family == "Debian" block: + - name: Install unattended-upgrades + ansible.builtin.apt: + name: unattended-upgrades + state: present + update_cache: true + notify: + - Run apt-get clean + - Run apt-get autoremove + - name: Configure unattended-upgrades package lists updates ansible.builtin.lineinfile: dest: /etc/apt/apt.conf.d/20auto-upgrades