Promote overcloud host image #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Promote overcloud host image | |
on: | |
workflow_dispatch: | |
inputs: | |
rocky9: | |
description: Promote Rocky Linux 9 | |
type: boolean | |
default: true | |
ubuntu-jammy: | |
description: Promote Ubuntu 22.04 Jammy | |
type: boolean | |
default: true | |
image_tag: | |
description: Tag to promote | |
type: string | |
required: true | |
env: | |
ANSIBLE_FORCE_COLOR: True | |
jobs: | |
overcloud-host-image-promote: | |
name: Promote overcloud host image | |
if: github.repository == 'stackhpc/stackhpc-kayobe-config' | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: src/kayobe-config | |
- name: Determine OpenStack release | |
id: openstack_release | |
run: | | |
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' .gitreview) | |
echo "openstack_release=${BRANCH}" | sed "s|stable/||" >> $GITHUB_OUTPUT | |
working-directory: src/kayobe-config | |
- name: Clone StackHPC Kayobe repository | |
uses: actions/checkout@v4 | |
with: | |
repository: stackhpc/kayobe | |
ref: refs/heads/stackhpc/${{ steps.openstack_release.outputs.openstack_release }} | |
path: src/kayobe | |
- name: Setup networking | |
run: | | |
if ! ip l show breth1 >/dev/null 2>&1; then | |
sudo ip l add breth1 type bridge | |
fi | |
sudo ip l set breth1 up | |
if ! ip a show breth1 | grep 192.168.33.3/24; then | |
sudo ip a add 192.168.33.3/24 dev breth1 | |
fi | |
if ! ip l show dummy1 >/dev/null 2>&1; then | |
sudo ip l add dummy1 type dummy | |
fi | |
sudo ip l set dummy1 up | |
sudo ip l set dummy1 master breth1 | |
- name: Install Kayobe | |
run: | | |
mkdir -p venvs && | |
pushd venvs && | |
python3 -m venv kayobe && | |
source kayobe/bin/activate && | |
pip install -U pip && | |
pip install ../src/kayobe | |
- name: Bootstrap the control host | |
run: | | |
source venvs/kayobe/bin/activate && | |
source src/kayobe-config/kayobe-env --environment ci-builder && | |
kayobe control host bootstrap | |
- name: Promote Rocky Linux 9 overcloud host image artifact | |
run: | | |
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-promote.yml \ | |
-e image_path='/opt/kayobe/images/overcloud-rocky-linux-9' \ | |
-e os_distribution='rocky' \ | |
-e os_release='9' | |
env: | |
OVERCLOUD_HOST_IMAGE_TAG: ${{ inputs.image_tag }} | |
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} | |
if: inputs.rocky9 | |
- name: Promote Ubuntu Jammy 22.04 overcloud host image artifact | |
run: | | |
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-promote.yml \ | |
-e image_path='/opt/kayobe/images/overcloud-ubuntu-jammy' \ | |
-e os_distribution='ubuntu' \ | |
-e os_release='jammy' | |
env: | |
OVERCLOUD_HOST_IMAGE_TAG: ${{ inputs.image_tag }} | |
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} | |
if: inputs.ubuntu-jammy |