diff --git a/playbook.yaml b/playbook.yaml index 6e2a08f..db81dcf 100644 --- a/playbook.yaml +++ b/playbook.yaml @@ -84,18 +84,30 @@ echo "127.0.1.1 {{ serverid }}" >> /etc/hosts changed_when: false - - name: Update and upgrade apt + - name: Update apt cache ansible.builtin.apt: update_cache: true - upgrade: dist - force_apt_get: true - autoremove: true register: apt_update_result retries: 5 delay: 50 until: apt_update_result is succeeded - async: "{{ 60 * 20 }}" - poll: 30 + + - name: Upgrade packages (dist-upgrade) + ansible.builtin.apt: + upgrade: dist + force_apt_get: true + register: apt_upgrade_result + retries: 5 + delay: 50 + until: apt_upgrade_result is succeeded + + - name: Autoremove unused packages + ansible.builtin.apt: + autoremove: true + register: apt_autoremove_result + retries: 5 + delay: 50 + until: apt_autoremove_result is succeeded - name: Install packages ansible.builtin.apt: