khuedoan-homelab/metal/shutdown.yml
Khue Doan 404454843a Revert "Use raw command for shutdown task"
This reverts commit 31de83b3ff.

Raw poweroff command only needed on CoreOS because it doesn't have
Python
2021-11-16 11:41:20 +07:00

12 lines
347 B
YAML

- 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