Skip to content

Commit 847d9e1

Browse files
author
Rodrique Heron
committed
Merge branch 'amalivert-master'
2 parents 5b594a9 + 0176c7c commit 847d9e1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tasks/deploy-vm.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,16 @@
7373
os_disk_size: "{{ os_virtual_disk_size.stdout | human_to_bytes }}"
7474
when: os_disk_created.stat.exists
7575

76+
- name: get os qcow device disk name
77+
shell: >
78+
virt-filesystems --partitions --long
79+
-a "{{ os_qcow_template }}" | awk '/partition /{print $1}'
80+
register: os_disk_device
81+
changed_when: false
82+
7683
- name: Push base image onto vm operating system disk
7784
command: >
78-
virt-resize --expand /dev/sda1 "{{ os_qcow_template }}" "{{ os_disk }}"
85+
virt-resize --expand "{{ os_disk_device.stdout }}" "{{ os_qcow_template }}" "{{ os_disk }}"
7986
register: resize_os_disk_results
8087
changed_when: '"Resize operation completed with no errors" in resize_os_disk_results.stdout'
8188
when: os_disk_created.stat.exists and os_disk_size|int < '1073741824'|int

0 commit comments

Comments
 (0)