Don't hard-code overcloud-full

This will soon be overcloud-hardened-uefi-full on master, and the
download will be of a qcow2 file, not a tar file.

This change moves whole_disk_images default setting to extras-common,
and also adds default variable overcloud_image, which is used wherever
'overcloud-full' is currently hard-coded.

Change-Id: Iba7833c16eae3d3129b7bab48434c66ec2e1efcf
Blueprint: whole-disk-default
This commit is contained in:
Steve Baker 2021-06-22 14:59:22 +12:00
parent 68129460d8
commit b911d3f9be
7 changed files with 18 additions and 14 deletions

View File

@ -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

View File

@ -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`: <false> Deploy composable network with "openstack
overcloud network provision" and deployed-networks, instead of with heat
- `whole_disk_images`: <false> -- 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

View File

@ -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

View File

@ -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

View File

@ -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: <false> -- a more robust version of the step_introspect option
Dependencies

View File

@ -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

View File

@ -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