Skip to content

Commit 08fe6af

Browse files
committed
CI: Register overcloud host image as shared and add stackhpc-dev
In order for developers to be able to use overcloud images for testing, they must be available in the stackhpc-dev project on Leafcloud. To do this we can make the image shared, and add stackhpc-dev as a member. Unfortunately someone in the stackhpc-dev project must also accept the image membership before it becomes active. It's not possible to do this with the existing app creds which are scoped to the stackhpc-ci project. Instead we provide instructions on how to do it as a debug message.
1 parent ee07cd3 commit 08fe6af

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

etc/kayobe/ansible/openstack-host-image-upload.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
- name: Ensure dependencies are installed
3333
pip:
34-
name: openstacksdk
34+
name: python-openstackclient
3535

3636
- name: Upload an image to Glance
3737
openstack.cloud.image:
@@ -41,6 +41,28 @@
4141
disk_format: qcow2
4242
state: present
4343
filename: "{{ local_image_path }}"
44+
visibility: shared
45+
register: image
46+
47+
# Allow users in stackhpc-dev to use these images.
48+
- name: Add image to stackhpc-dev project
49+
command: openstack image add project {{ image.image.id }} stackhpc-dev
50+
51+
# FIXME: This needs to be done when authenticated in the stackhpc-dev
52+
# project, but we don't have an app cred for this. It must be done
53+
# manually for now.
54+
# - name: Accept image membership in stackhpc-dev project
55+
# command: openstack image set {{ image.image.id }} --accept
56+
57+
- name: Display how to add the image to the stackhpc-dev project
58+
debug:
59+
msg: |-
60+
The {{ image_name }} image has been shared with the stackhpc-dev
61+
project but it must be accepted by a user authenticated in the
62+
stackhpc-dev project before it can be used there. This can be
63+
done using the following command:
64+
65+
openstack image add project {{ image.image.id }} stackhpc-dev
4466
4567
always:
4668
- name: Remove clouds.yaml

0 commit comments

Comments
 (0)