Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/overcloud-host-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ jobs:

# Generate a tag to apply to all built overcloud host images.
- name: Generate overcloud host image tag
id: host_image_tag
id: image_tag
run: |
echo "host_image_tag=$(date +${{ steps.openstack_release.outputs.openstack_release }}-%Y%m%dT%H%M%S)" >> $GITHUB_OUTPUT
echo "image_tag=$(date +${{ steps.openstack_release.outputs.openstack_release }}-%Y%m%dT%H%M%S)" >> $GITHUB_OUTPUT

- name: Display overcloud host image tag
run: |
echo "${{ steps.host_image_tag.outputs.host_image_tag }}"
echo "${{ steps.image_tag.outputs.image_tag }}"

- name: Install Kayobe
run: |
Expand Down Expand Up @@ -239,9 +239,9 @@ jobs:
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe playbook run \
src/kayobe-config/etc/kayobe/ansible/pulp-host-image-upload.yml \
src/kayobe-config/etc/kayobe/ansible/pulp-image-upload.yml \
-e image_path=/opt/kayobe/images/overcloud-rocky-9 \
-e host_image_tag=${{ steps.host_image_tag.outputs.host_image_tag }} \
-e image_tag=${{ steps.image_tag.outputs.image_tag }} \
-e os_distribution="rocky" \
-e os_release="9"
env:
Expand All @@ -255,7 +255,7 @@ jobs:
kayobe playbook run \
src/kayobe-config/etc/kayobe/ansible/openstack-host-image-upload.yml \
-e local_image_path="/opt/kayobe/images/overcloud-rocky-9/overcloud-rocky-9.qcow2" \
-e image_name=overcloud-rocky-9-${{ steps.host_image_tag.outputs.host_image_tag }}
-e image_name=overcloud-rocky-9-${{ steps.image_tag.outputs.image_tag }}
env:
CLOUDS_YAML: ${{ secrets.CLOUDS_YAML }}
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
Expand Down Expand Up @@ -291,9 +291,9 @@ jobs:
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe playbook run \
src/kayobe-config/etc/kayobe/ansible/pulp-host-image-upload.yml \
src/kayobe-config/etc/kayobe/ansible/pulp-image-upload.yml \
-e image_path=/opt/kayobe/images/overcloud-ubuntu-jammy \
-e host_image_tag=${{ steps.host_image_tag.outputs.host_image_tag }} \
-e image_tag=${{ steps.image_tag.outputs.image_tag }} \
-e os_distribution="ubuntu" \
-e os_release="jammy"
env:
Expand All @@ -307,7 +307,7 @@ jobs:
kayobe playbook run \
src/kayobe-config/etc/kayobe/ansible/openstack-host-image-upload.yml \
-e local_image_path="/opt/kayobe/images/overcloud-ubuntu-jammy/overcloud-ubuntu-jammy.qcow2" \
-e image_name=overcloud-ubuntu-jammy-${{ steps.host_image_tag.outputs.host_image_tag }}
-e image_name=overcloud-ubuntu-jammy-${{ steps.image_tag.outputs.image_tag }}
env:
CLOUDS_YAML: ${{ secrets.CLOUDS_YAML }}
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
remote_pulp_password: "{{ stackhpc_image_repository_password }}"
repository_name: "kayobe-images-{{ openstack_release }}-{{ os_distribution }}-{{ os_release }}"
pulp_base_path: "kayobe-images/{{ openstack_release }}/{{ os_distribution }}/{{ os_release }}"
file_extension: '*.qcow2'
tasks:
- name: Print image tag
debug:
msg: "Image tag: {{ host_image_tag }}"
msg: "Image tag: {{ image_tag }}"

- name: Get filename
find:
paths: "{{ image_path }}"
patterns: '*.qcow2'
patterns: "{{ file_extension }}"
register: found_files

- name: Upload an artifact
Expand Down Expand Up @@ -107,8 +108,8 @@
pulp_url: "{{ remote_pulp_url }}"
username: "{{ remote_pulp_username }}"
password: "{{ remote_pulp_password }}"
name: "{{ repository_name }}_{{ host_image_tag }}"
base_path: "{{ pulp_base_path }}/{{ host_image_tag }}"
name: "{{ repository_name }}_{{ image_tag }}"
base_path: "{{ pulp_base_path }}/{{ image_tag }}"
publication: "{{ publication_details.publication.pulp_href }}"
content_guard: development
state: present
Expand All @@ -122,7 +123,7 @@
lineinfile:
path: /tmp/updated_images.txt
line: "{{ remote_pulp_url }}/pulp/content/{{ pulp_base_path }}/\
{{ host_image_tag }}/{{ found_files.files[0].path | basename }}"
{{ image_tag }}/{{ found_files.files[0].path | basename }}"
create: true

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

- name: Print latest path
Expand All @@ -146,5 +147,5 @@

- name: Print version tag
debug:
msg: "New tag: {{ host_image_tag }}"
msg: "New tag: {{ image_tag }}"
when: latest_distribution_details.changed