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

9 lines
488 B
YAML

---
- name: 'Check the {{ item }} volume size for {{ vm }} (Volume Size - {{ hostvars[vm].volume[item] | int }})'
command: 'qvm-volume info {{ vm }}:{{ item }} size'
register: qvm_volume_size
changed_when: false
- name: 'Ensure the {{ item }} volume size is correctly set on the {{ vm }} VM'
command: 'qvm-volume resize {{ vm }}:{{ item }} {{ ((hostvars[vm].volume[item] | int) * 1073741824) }}'
when: qvm_volume_size.stdout != ((hostvars[vm].volume[item] | int) * 1073741824)