From 7d2b916af16a8ab4bf9c080610fc37bdb3ecbfa8 Mon Sep 17 00:00:00 2001 From: Clintchiz Date: Wed, 17 Sep 2025 10:34:10 +0530 Subject: [PATCH] Update update-apt-packages.yaml --- update-apt-packages.yaml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/update-apt-packages.yaml b/update-apt-packages.yaml index 31c8002..040c194 100644 --- a/update-apt-packages.yaml +++ b/update-apt-packages.yaml @@ -1,9 +1,14 @@ --- -- hosts: all +- name: Update and upgrade apt packages + hosts: all - become: true tasks: - - name: update apt packages - apt: - upgrade: yes - update_cache: yes \ No newline at end of file + - 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