[modify-image] Ensure qemu-img is installed

The role relies on qemu-image rpm, let's ensure
it's installed.

It used to be installed with tripleoclient before
[1], since the role relies on that rpm let's have
it as part of role.

Also use set -eo pipefail for convert image task
so that task fail if any part of the script fails.

[1] https://review.rdoproject.org/r/#/c/30690/

Closes-Bug: #1906486
Change-Id: I532e236caad86941db8a4cfcffa4be67c76502b5
This commit is contained in:
yatinkarel 2020-12-02 17:30:05 +05:30
parent 2c5d8abd97
commit c7905f0b44
1 changed files with 7 additions and 0 deletions

View File

@ -13,6 +13,12 @@
set_fact:
mount_tempdir: "{{ mktemp_command.stdout }}"
- name: Ensure qemu-img is installed
package:
name: qemu-img
state: present
become: true
- when: not initramfs_image|bool
block:
@ -23,6 +29,7 @@
- name: Convert image
shell: >
set -eo pipefail;
qemu-img convert -f qcow2 -O raw {{ image_to_modify_qcow }} {{ image_to_modify_raw }};
rm -rf "{{ image_to_modify_qcow }}";