From 46af66cf7d7f7e52c0abe871e25be24929760c15 Mon Sep 17 00:00:00 2001 From: Clintchiz Date: Wed, 17 Sep 2025 10:45:44 +0530 Subject: [PATCH] Update update-apt-packages.yaml --- update-apt-packages.yaml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/update-apt-packages.yaml b/update-apt-packages.yaml index 040c194..fc7bf09 100644 --- a/update-apt-packages.yaml +++ b/update-apt-packages.yaml @@ -1,14 +1,10 @@ --- -- name: Update and upgrade apt packages - hosts: all - +- hosts: all + become: true tasks: - - name: Update packages with apt - when: ansible_pkg_mgr == 'apt' - ansible.builtin.apt: - update_cache: true - - - name: Upgrade packages with apt - when: ansible_pkg_mgr == 'apt' - ansible.builtin.apt: - upgrade: dist \ No newline at end of file + - name: Update apt cache and upgrade all packages + apt: + update_cache: yes + upgrade: dist + autoremove: yes + autoclean: yes \ No newline at end of file