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

10 lines
488 B
YAML
Raw Normal View History

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