install.fairie/home/dot_local/share/ansible/tasks/qubes/qvm-shutdown.yml
2023-07-16 01:40:26 -04:00

16 lines
475 B
YAML

---
- name: Check if the VM is running
command: qvm-check {{ item }}
register: qvm_check_vm
- name: Shutdown the {{ item }} VM
command: qvm-shutdown --wait {{ item }}
when:
- not (force_shutdown | default(false))
- qvm_check_vm.rc == 0
- name: Force the shutdown of the {{ item }} VM (only to be done after proper shutdown of an HVM)
command: qvm-shutdown --wait --force {{ item }}
when:
- force_shutdown | default(false)
- qvm_check_vm.rc == 0