install.fairie/home/dot_local/share/ansible/tasks/qubes/qvm-shutdown.yml

17 lines
475 B
YAML
Raw Normal View History

2023-07-15 22:40:26 -07:00
---
- 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