Skip to content

Commit a798ad9

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 a798ad9

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

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

Lines changed: 28 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,33 @@
4141
disk_format: qcow2
4242
state: present
4343
filename: "{{ local_image_path }}"
44+
# FIXME: Uncomment this when we have a newer openstack.cloud collection
45+
#visibility: shared
46+
register: image
47+
48+
# FIXME: Remove this when we have a newer openstack.cloud collection
49+
- name: Make the image shared
50+
command: openstack image set --shared {{ image.image.id }}
51+
52+
# Allow users in stackhpc-dev to use these images.
53+
- name: Add image to stackhpc-dev project
54+
command: openstack image add project {{ image.image.id }} stackhpc-dev
55+
56+
# FIXME: This needs to be done when authenticated in the stackhpc-dev
57+
# project, but we don't have an app cred for this. It must be done
58+
# manually for now.
59+
# - name: Accept image membership in stackhpc-dev project
60+
# command: openstack image set {{ image.image.id }} --accept
61+
62+
- name: Display how to add the image to the stackhpc-dev project
63+
debug:
64+
msg: |-
65+
The {{ image_name }} image has been shared with the stackhpc-dev
66+
project but it must be accepted by a user authenticated in the
67+
stackhpc-dev project before it can be used there. This can be
68+
done using the following command:
69+
70+
openstack image add project {{ image.image.id }} stackhpc-dev
4471
4572
always:
4673
- name: Remove clouds.yaml

0 commit comments

Comments
 (0)