diff --git a/releasenotes/notes/generic-convert-image-5605efaea6828aad.yaml b/releasenotes/notes/generic-convert-image-5605efaea6828aad.yaml new file mode 100644 index 000000000..24df63d1d --- /dev/null +++ b/releasenotes/notes/generic-convert-image-5605efaea6828aad.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + Added the ability to better control what happens when converting an + overcloud-full.qcow2 image into an undercloud image. It is now possible to + change whether an update is run (convert_image_update|bool), what packages + should be removed (convert_image_remove_pkgs|list), what packages should + be installed (convert_image_install_pkgs|list, and what tempest plugins + should be installed (convert_image_tempest_plugins|list). diff --git a/roles/convert-image/README.md b/roles/convert-image/README.md new file mode 100644 index 000000000..a0b039aaf --- /dev/null +++ b/roles/convert-image/README.md @@ -0,0 +1,21 @@ +# Convert an overcloud-full.qcow2 into an image to boot an undercloud from + +The `convert-image` role transforms a overcloud-full image into one which an +undercloud can be booted from in order to save time on package installs, while +not needing to maintain/host a specific undercloud image. + +## Variables + +* `convert_image_working_dir`: -- directory to be used for image conversion +* `convert_image_template`: jinja template for the script which does the + conversion +* `convert_image_update`: Boolean controlling whether to run an update as part + of the image conversion +* `convert_image_remove_pkgs`: List of packages that need to be removed from + the overcloud image +* `convert_image_install_pkgs`: List of packages that need to be installed on + the overcloud image +* `convert_image_tempest_plugins`: List of tempest plugins to install (This is + separate from the install list so that it can be allowed to fail without + failing the conversion) + diff --git a/roles/convert-image/defaults/main.yml b/roles/convert-image/defaults/main.yml index fa685443e..a6f3eb2b3 100644 --- a/roles/convert-image/defaults/main.yml +++ b/roles/convert-image/defaults/main.yml @@ -2,3 +2,32 @@ convert_image_working_dir: "{{ working_dir }}" convert_image_template: convert_image.sh.j2 +# Do a yum update when converting overcloud to undercloud +convert_image_update: true + +# List of packages that should be removed from the overcloud image +convert_image_remove_pkgs: + - cloud-init + - python-django-horizon + - openstack-dashboard + +# List of packages that should be installed to convert overcloud to undercloud +convert_image_install_pkgs: + - python-tripleoclient + +# List of tempest plugins to install. This is separated from the other install +# packages list, because it is allowed to fail if there is some issue +# installing the tempest plugins. +convert_image_tempest_plugins: + - openstack-tempest + - python-aodh-tests + - python-ceilometer-tests + - python-heat-tests + - python-ironic-tests + - python-keystone-tests + - python-manila-tests + - python-mistral-tests + - python-neutron-tests + - python-sahara-tests + - python-zaqar-tests + diff --git a/roles/convert-image/templates/convert_image.sh.j2 b/roles/convert-image/templates/convert_image.sh.j2 index 2f0c75dec..a4c9f7a6e 100644 --- a/roles/convert-image/templates/convert_image.sh.j2 +++ b/roles/convert-image/templates/convert_image.sh.j2 @@ -15,19 +15,18 @@ fi {% if not undercloud_setup|bool %} +{% if convert_image_update|bool %} yum update -y +{% endif %} -yum remove -y cloud-init python-django-horizon openstack-dashboard -yum install -y python-tripleoclient +yum remove -y {{ convert_image_remove_pkgs|join(" ") }} +yum install -y {{ convert_image_install_pkgs|join(" ") }} # NOTE(trown) Install tempest and test packages in a seperate yum transaction # so that we do not fail the conversion if this install fails. There is a period # after TripleO uploads a new image, but before the buildlogs repo gets synced, # where this will fail because we try to install older test packages than the # service packages already installed in the image. -yum install -y openstack-tempest python-aodh-tests python-ceilometer-tests \ -python-heat-tests python-ironic-tests python-keystone-tests python-manila-tests \ -python-mistral-tests python-neutron-tests python-sahara-tests python-zaqar-tests \ -|| /bin/true +yum install -y {{ convert_image_tempest_plugins|join(" ") }} || /bin/true {% endif %}