--- - name: Convert an overcloud image to an undercloud hosts: localhost become: yes become_user: root vars: ansible_python_interpreter: /usr/bin/python repo_inject_image_path: "overcloud-full.qcow2" repo_run_live: false working_dir: ./ overcloud_as_undercloud: true modify_image_vc_verbose: true modify_image_vc_trace: true tasks: - include_role: name: "repo-setup" - include_role: name: "convert-image" # Inject updated overcloud and ipa images into our converted undercloud # image - name: Inject additional images command: > virt-customize -a {{ working_dir }}/undercloud.qcow2 --upload {{ working_dir }}/{{ item }}:/home/stack/{{ item }} --run-command 'chown stack:stack /home/stack/{{ item }}' environment: LIBGUESTFS_BACKEND: direct LIBVIRT_DEFAULT_URI: qemu:///session changed_when: true with_items: "{{ inject_images | default('') }}" - name: Compress the undercloud image shell: > qemu-img convert -c -O qcow2 {{ working_dir }}/undercloud.qcow2 {{ working_dir }}/undercloud-compressed.qcow2; mv {{ working_dir }}/undercloud-compressed.qcow2 {{ working_dir }}/undercloud.qcow2