Browse Source

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
tags/2.1.1
John Trowbridge 1 year ago
parent
commit
a38e9635bb

+ 9
- 0
releasenotes/notes/generic-convert-image-5605efaea6828aad.yaml View File

@@ -0,0 +1,9 @@
1
+---
2
+features:
3
+  - |
4
+    Added the ability to better control what happens when converting an
5
+    overcloud-full.qcow2 image into an undercloud image. It is now possible to
6
+    change whether an update is run (convert_image_update|bool), what packages
7
+    should be removed (convert_image_remove_pkgs|list), what packages should
8
+    be installed (convert_image_install_pkgs|list, and what tempest plugins
9
+    should be installed (convert_image_tempest_plugins|list).

+ 21
- 0
roles/convert-image/README.md View File

@@ -0,0 +1,21 @@
1
+# Convert an overcloud-full.qcow2 into an image to boot an undercloud from
2
+
3
+The `convert-image` role transforms a overcloud-full image into one which an
4
+undercloud can be booted from in order to save time on package installs, while
5
+not needing to maintain/host a specific undercloud image.
6
+
7
+## Variables
8
+
9
+* `convert_image_working_dir`: -- directory to be used for image conversion
10
+* `convert_image_template`: jinja template for the script which does the
11
+  conversion
12
+* `convert_image_update`: Boolean controlling whether to run an update as part
13
+  of the image conversion
14
+* `convert_image_remove_pkgs`: List of packages that need to be removed from
15
+  the overcloud image
16
+* `convert_image_install_pkgs`: List of packages that need to be installed on
17
+  the overcloud image
18
+* `convert_image_tempest_plugins`: List of tempest plugins to install (This is
19
+  separate from the install list so that it can be allowed to fail without
20
+  failing the conversion)
21
+

+ 29
- 0
roles/convert-image/defaults/main.yml View File

@@ -2,3 +2,32 @@
2 2
 convert_image_working_dir: "{{ working_dir }}"
3 3
 convert_image_template: convert_image.sh.j2
4 4
 
5
+# Do a yum update when converting overcloud to undercloud
6
+convert_image_update: true
7
+
8
+# List of packages that should be removed from the overcloud image
9
+convert_image_remove_pkgs:
10
+  - cloud-init
11
+  - python-django-horizon
12
+  - openstack-dashboard
13
+
14
+# List of packages that should be installed to convert overcloud to undercloud
15
+convert_image_install_pkgs:
16
+  - python-tripleoclient
17
+
18
+# List of tempest plugins to install. This is separated from the other install
19
+# packages list, because it is allowed to fail if there is some issue
20
+# installing the tempest plugins.
21
+convert_image_tempest_plugins:
22
+  - openstack-tempest
23
+  - python-aodh-tests
24
+  - python-ceilometer-tests
25
+  - python-heat-tests
26
+  - python-ironic-tests
27
+  - python-keystone-tests
28
+  - python-manila-tests
29
+  - python-mistral-tests
30
+  - python-neutron-tests
31
+  - python-sahara-tests
32
+  - python-zaqar-tests
33
+

+ 5
- 6
roles/convert-image/templates/convert_image.sh.j2 View File

@@ -15,19 +15,18 @@ fi
15 15
 
16 16
 {% if not undercloud_setup|bool %}
17 17
 
18
+{% if convert_image_update|bool %}
18 19
 yum update -y
20
+{% endif %}
19 21
 
20
-yum remove -y cloud-init python-django-horizon openstack-dashboard
21
-yum install -y python-tripleoclient
22
+yum remove -y {{ convert_image_remove_pkgs|join(" ") }}
23
+yum install -y {{ convert_image_install_pkgs|join(" ") }}
22 24
 # NOTE(trown) Install tempest and test packages in a seperate yum transaction
23 25
 # so that we do not fail the conversion if this install fails. There is a period
24 26
 # after TripleO uploads a new image, but before the buildlogs repo gets synced,
25 27
 # where this will fail because we try to install older test packages than the
26 28
 # service packages already installed in the image.
27
-yum install -y openstack-tempest python-aodh-tests python-ceilometer-tests \
28
-python-heat-tests python-ironic-tests python-keystone-tests python-manila-tests \
29
-python-mistral-tests python-neutron-tests python-sahara-tests python-zaqar-tests \
30
-|| /bin/true
29
+yum install -y {{ convert_image_tempest_plugins|join(" ") }} || /bin/true
31 30
 
32 31
 {% endif %}
33 32
 

Loading…
Cancel
Save