From 85a806bf491417ca1916b109041bfb9ce27d0d98 Mon Sep 17 00:00:00 2001 From: Noah Knegt Date: Mon, 27 Feb 2023 16:55:31 +0100 Subject: [PATCH] base: Add cleanup tasks Signed-off-by: Noah Knegt --- playbooks/base.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/playbooks/base.yml b/playbooks/base.yml index abe22e6..0c57e87 100644 --- a/playbooks/base.yml +++ b/playbooks/base.yml @@ -12,3 +12,19 @@ become: true roles: - base + +# Clean up the system +- hosts: all + become: true + tasks: + - name: cleanup package cache (debian and ubuntu) + apt: + autoclean: yes + changed_when: false + when: ansible_os_family == "Debian" + + - name: autoremove packages (debian and ubuntu) + apt: + autoremove: yes + purge: yes + when: ansible_os_family == "Debian"