Promote overcloud host image #14
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: | |
centos: | |
description: Promote CentOS Stream 8 | |
type: boolean | |
default: true | |
rocky8: | |
description: Promote Rocky Linux 8 | |
type: boolean | |
default: true | |
rocky9: | |
description: Promote Rocky Linux 9 | |
type: boolean | |
default: true | |
ubuntu-focal: | |
description: Promote Ubuntu 20.04 Focal | |
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: [self-hosted, stackhpc-kayobe-config-kolla-builder] | |
steps: | |
- uses: actions/checkout@v3 | |
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 | |
- name: Clone StackHPC Kayobe repository | |
uses: actions/checkout@v3 | |
with: | |
repository: stackhpc/kayobe | |
ref: refs/heads/stackhpc/${{ steps.openstack_release.outputs.openstack_release }} | |
path: src/kayobe | |
# FIXME: Failed in kolla-ansible : Ensure the latest version of pip is installed | |
- name: Install dependencies | |
run: | | |
sudo dnf -y install python3-virtualenv | |
- 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 CentOS Stream 8 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-centos-8-stream' \ | |
-e os_distribution='centos' \ | |
-e os_release='8-stream' | |
env: | |
OVERCLOUD_HOST_IMAGE_TAG: ${{ inputs.image_tag }} | |
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} | |
if: inputs.centos | |
- name: Promote Rocky Linux 8 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-8' \ | |
-e os_distribution='rocky' \ | |
-e os_release='8' | |
env: | |
OVERCLOUD_HOST_IMAGE_TAG: ${{ inputs.image_tag }} | |
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} | |
if: inputs.rocky8 | |
- 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 Focal 20.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-focal' \ | |
-e os_distribution='ubuntu' \ | |
-e os_release='focal' | |
env: | |
OVERCLOUD_HOST_IMAGE_TAG: ${{ inputs.image_tag }} | |
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} | |
if: inputs.ubuntu-focal | |
- 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 |