Skip to content

Commit 598f4de

Browse files
Generalise image upload playbook
1 parent fe96cb4 commit 598f4de

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

.github/workflows/overcloud-host-image-build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ jobs:
6666
6767
# Generate a tag to apply to all built overcloud host images.
6868
- name: Generate overcloud host image tag
69-
id: host_image_tag
69+
id: image_tag
7070
run: |
71-
echo "host_image_tag=$(date +${{ steps.openstack_release.outputs.openstack_release }}-%Y%m%dT%H%M%S)" >> $GITHUB_OUTPUT
71+
echo "image_tag=$(date +${{ steps.openstack_release.outputs.openstack_release }}-%Y%m%dT%H%M%S)" >> $GITHUB_OUTPUT
7272
7373
- name: Display overcloud host image tag
7474
run: |
75-
echo "${{ steps.host_image_tag.outputs.host_image_tag }}"
75+
echo "${{ steps.image_tag.outputs.image_tag }}"
7676
7777
- name: Install Kayobe
7878
run: |
@@ -241,7 +241,7 @@ jobs:
241241
kayobe playbook run \
242242
src/kayobe-config/etc/kayobe/ansible/pulp-host-image-upload.yml \
243243
-e image_path=/opt/kayobe/images/overcloud-rocky-9 \
244-
-e host_image_tag=${{ steps.host_image_tag.outputs.host_image_tag }} \
244+
-e image_tag=${{ steps.image_tag.outputs.image_tag }} \
245245
-e os_distribution="rocky" \
246246
-e os_release="9"
247247
env:
@@ -255,7 +255,7 @@ jobs:
255255
kayobe playbook run \
256256
src/kayobe-config/etc/kayobe/ansible/openstack-host-image-upload.yml \
257257
-e local_image_path="/opt/kayobe/images/overcloud-rocky-9/overcloud-rocky-9.qcow2" \
258-
-e image_name=overcloud-rocky-9-${{ steps.host_image_tag.outputs.host_image_tag }}
258+
-e image_name=overcloud-rocky-9-${{ steps.image_tag.outputs.image_tag }}
259259
env:
260260
CLOUDS_YAML: ${{ secrets.CLOUDS_YAML }}
261261
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
@@ -293,7 +293,7 @@ jobs:
293293
kayobe playbook run \
294294
src/kayobe-config/etc/kayobe/ansible/pulp-host-image-upload.yml \
295295
-e image_path=/opt/kayobe/images/overcloud-ubuntu-jammy \
296-
-e host_image_tag=${{ steps.host_image_tag.outputs.host_image_tag }} \
296+
-e image_tag=${{ steps.image_tag.outputs.image_tag }} \
297297
-e os_distribution="ubuntu" \
298298
-e os_release="jammy"
299299
env:
@@ -307,7 +307,7 @@ jobs:
307307
kayobe playbook run \
308308
src/kayobe-config/etc/kayobe/ansible/openstack-host-image-upload.yml \
309309
-e local_image_path="/opt/kayobe/images/overcloud-ubuntu-jammy/overcloud-ubuntu-jammy.qcow2" \
310-
-e image_name=overcloud-ubuntu-jammy-${{ steps.host_image_tag.outputs.host_image_tag }}
310+
-e image_name=overcloud-ubuntu-jammy-${{ steps.image_tag.outputs.image_tag }}
311311
env:
312312
CLOUDS_YAML: ${{ secrets.CLOUDS_YAML }}
313313
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
tasks:
1111
- name: Print image tag
1212
debug:
13-
msg: "Image tag: {{ host_image_tag }}"
13+
msg: "Image tag: {{ image_tag }}"
1414

1515
- name: Get filename
1616
find:
@@ -107,8 +107,8 @@
107107
pulp_url: "{{ remote_pulp_url }}"
108108
username: "{{ remote_pulp_username }}"
109109
password: "{{ remote_pulp_password }}"
110-
name: "{{ repository_name }}_{{ host_image_tag }}"
111-
base_path: "{{ pulp_base_path }}/{{ host_image_tag }}"
110+
name: "{{ repository_name }}_{{ image_tag }}"
111+
base_path: "{{ pulp_base_path }}/{{ image_tag }}"
112112
publication: "{{ publication_details.publication.pulp_href }}"
113113
content_guard: development
114114
state: present
@@ -122,7 +122,7 @@
122122
lineinfile:
123123
path: /tmp/updated_images.txt
124124
line: "{{ remote_pulp_url }}/pulp/content/{{ pulp_base_path }}/\
125-
{{ host_image_tag }}/{{ found_files.files[0].path | basename }}"
125+
{{ image_tag }}/{{ found_files.files[0].path | basename }}"
126126
create: true
127127

128128
- name: Update new images file with latest path
@@ -135,7 +135,7 @@
135135
- name: Print versioned path
136136
debug:
137137
msg: "New versioned path: {{ remote_pulp_url }}/pulp/content/{{ pulp_base_path }}/\
138-
{{ host_image_tag }}/{{ found_files.files[0].path | basename }}"
138+
{{ image_tag }}/{{ found_files.files[0].path | basename }}"
139139
when: latest_distribution_details.changed
140140

141141
- name: Print latest path
@@ -146,5 +146,5 @@
146146

147147
- name: Print version tag
148148
debug:
149-
msg: "New tag: {{ host_image_tag }}"
149+
msg: "New tag: {{ image_tag }}"
150150
when: latest_distribution_details.changed

0 commit comments

Comments
 (0)