Make the convert-image role more generic

Specifically this patch adds knobs for controlling whether:
- an update is run (convert_image_update)
- what packages get removed (convert_image_remove_pkgs)
- what packages get installed (convert_image_install_pkgs)
- what tempest plugins get installed (convert_image_tempest-plugins)

All defaults for the above options are set to the current hardcoded
values, so this is a no-op change wrt current configurations.
However, it allows for new configurations to take advantage of this
feature.

Change-Id: Iecb2d07e4451eb97c958dcf19d9a76aa0982acef
Related-Bug: 1719902
This commit is contained in:
John Trowbridge 2017-10-02 08:44:36 -04:00
parent 9a2feda169
commit a38e9635bb
4 changed files with 64 additions and 6 deletions

View File

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

View File

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

View File

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

View File

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