diff --git a/roles/build-images/tasks/main.yml b/roles/build-images/tasks/main.yml index 983fa8014..dd936120f 100644 --- a/roles/build-images/tasks/main.yml +++ b/roles/build-images/tasks/main.yml @@ -31,7 +31,7 @@ dib_yum_repo_conf: "{{ overcloud_repo_paths }}" workspace: "{{ images_working_dir }}" build_all_images: true - tripleo_image_type: overcloud-full + tripleo_image_type: "{{ overcloud_image }}" tripleo_common_path: "/usr/share/tripleo-common" include_role: name: oooci-build-images @@ -45,7 +45,7 @@ include_role: name: install-built-repo vars: - ib_repo_image_path: "{{ images_working_dir }}/overcloud-full.qcow2" + ib_repo_image_path: "{{ images_working_dir }}/{{ overcloud_image }}.qcow2" - name: Enject repo in IPA image include_role: @@ -100,7 +100,7 @@ virt-cat -a {{ build_isolation_image.name }}.qcow2 \ /ironic-python-agent.log > ironic-python-agent.log 2>&1 || true virt-cat -a {{ build_isolation_image.name }}.qcow2 \ - /overcloud-full.log > overcloud-full.log 2>&1 || true + /{{ overcloud_image }}.log > {{ overcloud_image }}.log 2>&1 || true environment: LIBGUESTFS_BACKEND: direct LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}" @@ -122,7 +122,7 @@ include: modify-image.yml vars: modify_images_working_dir: "{{ images_working_dir }}" - image_to_modify: "{{ images_working_dir }}/overcloud-full.qcow2" + image_to_modify: "{{ images_working_dir }}/{{ overcloud_image }}.qcow2" modify_script: "{{ images_working_dir }}/repo_setup.sh" - name: convert the overcloud image to an undercloud image @@ -156,6 +156,6 @@ - name: Clean up the images working dir shell: >- - rm -rf {{ images_working_dir }}/overcloud-full.d {{ images_working_dir }}/ironic-python-agent.d/ - sudo chown $USER: {{ images_working_dir }}/overcloud-full.* {{ images_working_dir }}/ironic-python-agent.* + rm -rf {{ images_working_dir }}/{{ overcloud_image }}.d {{ images_working_dir }}/ironic-python-agent.d/ + sudo chown $USER: {{ images_working_dir }}/{{ overcloud_image }}.* {{ images_working_dir }}/ironic-python-agent.* when: cleanup_images_working_dir|bool diff --git a/roles/extras-common/README.md b/roles/extras-common/README.md index 6afe08fb5..6ccdbb9c0 100644 --- a/roles/extras-common/README.md +++ b/roles/extras-common/README.md @@ -50,3 +50,5 @@ Role Variables in undercloud.conf for the undercloud and install ara in the mistral executor container before deploying the overcloud. - `network_provision`: Deploy composable network with "openstack overcloud network provision" and deployed-networks, instead of with heat +- `whole_disk_images`: -- shows if we want to use partition or whole disk images (this will be available starting on Ocata) +- `overcloud_image`: <'overcloud-full'> Name of overcloud image to build/download/deploy without any file extension diff --git a/roles/extras-common/defaults/main.yml b/roles/extras-common/defaults/main.yml index f7bdfd5c8..e74e675a4 100644 --- a/roles/extras-common/defaults/main.yml +++ b/roles/extras-common/defaults/main.yml @@ -167,3 +167,5 @@ undercloud_enable_swift: >- false {%- endif %} undercloud_enable_heat: "{{ not ephemeral_heat|default(false) }}" +whole_disk_images: false +overcloud_image: overcloud-full diff --git a/roles/modify-image/README.md b/roles/modify-image/README.md index 9933bd4bc..3bd7c03b0 100644 --- a/roles/modify-image/README.md +++ b/roles/modify-image/README.md @@ -105,7 +105,7 @@ Example Usage - name: Install packages in the image hosts: virthost vars: - image_to_modify: "{{ working_dir }}/overcloud-full.qcow2" + image_to_modify: "{{ working_dir }}/{{ overcloud_image }}.qcow2" modify_image_install_packages: - 'package_to_be_installed_1' - 'package_to_be_installed_2' @@ -116,7 +116,7 @@ Example Usage - name: Upload an RPM file and install it in the image hosts: virthost vars: - image_to_modify: "{{ working_dir }}/overcloud-full.qcow2" + image_to_modify: "{{ working_dir }}/{{ overcloud_image }}.qcow2" modify_image_upload_files: - src: "/tmp/rpm_to_be_uploaded.rpm" dest: /root/rpm_to_be_installed.rpm diff --git a/roles/overcloud-prep-images/README.md b/roles/overcloud-prep-images/README.md index 087b8ceb5..be35e7d9a 100644 --- a/roles/overcloud-prep-images/README.md +++ b/roles/overcloud-prep-images/README.md @@ -32,7 +32,6 @@ Role Variables Please note that in order to match root device hints with the associated nodes on `instackenv.json`, the node `pm_address` will be used as a key. At the moment only equal operator is supported, is not possible to use other operators or logical combinations. -- whole_disk_images: false -- shows if we want to use partition or whole disk images (this will be available starting on Ocata) - step_introspect_with_retry: -- a more robust version of the step_introspect option Dependencies diff --git a/roles/overcloud-prep-images/defaults/main.yml b/roles/overcloud-prep-images/defaults/main.yml index da942e814..ca28d3766 100644 --- a/roles/overcloud-prep-images/defaults/main.yml +++ b/roles/overcloud-prep-images/defaults/main.yml @@ -39,7 +39,5 @@ step_root_device_size: false disk_root_device_size: 1843 step_root_device_hints: false root_device_hints: [] -whole_disk_images: false download_overcloud_image: false -overcloud_full_tar_name: overcloud-full.tar diff --git a/roles/overcloud-prep-images/templates/download-overcloud-image.sh.j2 b/roles/overcloud-prep-images/templates/download-overcloud-image.sh.j2 index 03344ac9f..60e280c68 100644 --- a/roles/overcloud-prep-images/templates/download-overcloud-image.sh.j2 +++ b/roles/overcloud-prep-images/templates/download-overcloud-image.sh.j2 @@ -7,10 +7,13 @@ set -eux ## * Download specific Overcloud images ## :: -if [ -f overcloud-full.qcow2 ]; then - sudo rm -rf overcloud-full* +if [ -f {{ overcloud_image }}.qcow2 ]; then + sudo rm -rf {{ overcloud_image }}.* fi curl -L -O "{{ overcloud_image_url }}" -tar xvfp {{ overcloud_full_tar_name }} + +{% if not whole_disk_images|bool %} +tar xvfp {{ overcloud_image }}.tar +{% endif %} ### --stop_docs