- name: Shutdown the homelab hosts: metal gather_facts: no tasks: - name: Unconditionally shut down the machine community.general.shutdown: delay: 0 ignore_unreachable: yes - name: Wait for the machine to shutdown shell: "until ! ping -c 1 {{ ansible_host }}; do sleep 1; done" delegate_to: localhost