khuedoan-homelab/metal/shutdown.yml
2021-06-08 19:00:56 +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