--- - name: Wait for SSH to become available delegate_to: localhost ansible.builtin.wait_for: host: "{{ ansible_host }}" port: 22 timeout: 3600 # Runs on the guest itself, over the connection the play uses for it. - name: Wait for cloud-init to finish ansible.builtin.command: cloud-init status --wait register: __pve_vm_cloudinit_status retries: 10 delay: 15 until: __pve_vm_cloudinit_status.rc == 0 changed_when: false