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