Introduce per project customization scripts interface

Do project specific installations by calling project specific
scripts located in scripts/project_specific/<project_name> directory.
The scripts are executed in alphabetical order.
Also move keystone oidc and nova console into own files

Change-Id: I1f381e85f095eee2bede3f4925f51c9103d83467
This commit is contained in:
Vasyl Saienko 2024-09-10 13:10:57 +00:00
parent 4226e755ee
commit 047353213d
4 changed files with 30 additions and 24 deletions

View File

@ -79,12 +79,13 @@ if [[ "${PLUGIN}" == "no" ]]; then
$(dirname $0)/pip_install.sh ${PYDEP_PACKAGES[@]}
fi
if [[ ${PROJECT} == 'nova' ]]; then
$(dirname $0)/install_nova_console.sh
fi
$(dirname $0)/clone_project.sh
$(dirname $0)/install_packages.sh
$(dirname $0)/pip_install.sh ${NO_INDEX} /tmp/${PROJECT} ${PIP_PACKAGES}
for project_script in $(ls $(dirname $0)/project_specific/${PROJECT}); do
echo "Running $PROJECT specific script $project_script"
$(dirname $0)/project_specific/${PROJECT}/$project_script
done
$(dirname $0)/configure_packages.sh
$(dirname $0)/collect_info.sh
$(dirname $0)/cleanup.sh

View File

@ -10,27 +10,6 @@ if [[ ! -z ${PACKAGES} ]]; then
case ${distro} in
ubuntu)
apt-get install -y --no-install-recommends ${PACKAGES[@]} ${DIST_PACKAGES}
# NOTE: This doesn't belong here. This should be a user shim or a
# custom base image configuration change to the apt sources
# "libapache2-mod-oauth2" package is available in Ubuntu 22.10
# NOTE(mnaser): mod_oauth2 is not available inside packaging repos, so we manually
# install it here.
if [[ "${PROFILES[*]}" =~ "mod_oauth2" ]] && [[ ${PROJECT} == 'keystone' ]] && [[ $(uname -p) == "x86_64" ]]; then
source /etc/lsb-release
apt-get install -y --no-install-recommends wget apache2
wget --no-check-certificate \
https://github.com/zmartzone/mod_oauth2/releases/download/v3.2.2/libapache2-mod-oauth2_3.2.2-1.${DISTRIB_CODENAME}+1_amd64.deb \
https://github.com/zmartzone/liboauth2/releases/download/v1.4.3/liboauth2_1.4.3-1.${DISTRIB_CODENAME}+1_amd64.deb
apt-get -y --no-install-recommends install \
./libapache2-mod-oauth2_3.2.2-1.${DISTRIB_CODENAME}+1_amd64.deb \
./liboauth2_1.4.3-1.${DISTRIB_CODENAME}+1_amd64.deb
a2enmod oauth2
rm -rfv \
./libapache2-mod-oauth2_3.2.2-1.${DISTRIB_CODENAME}+1_amd64.deb \
./liboauth2_1.4.3-1.${DISTRIB_CODENAME}+1_amd64.deb
apt-get purge -y wget
fi
;;
centos)
yum -y --setopt=skip_missing_names_on_install=False install ${PACKAGES[@]} ${DIST_PACKAGES}

View File

@ -0,0 +1,26 @@
#!/bin/bash
set -ex
if [[ ${distro} -eq "ubuntu" ]]; then
# NOTE: This doesn't belong here. This should be a user shim or a
# custom base image configuration change to the apt sources
# "libapache2-mod-oauth2" package is available in Ubuntu 22.10
# NOTE(mnaser): mod_oauth2 is not available inside packaging repos, so we manually
# install it here.
if [[ "${PROFILES[*]}" =~ "mod_oauth2" ]] && [[ ${PROJECT} == 'keystone' ]] && [[ $(uname -p) == "x86_64" ]]; then
source /etc/lsb-release
apt-get install -y --no-install-recommends wget apache2
wget --no-check-certificate \
https://github.com/zmartzone/mod_oauth2/releases/download/v3.2.2/libapache2-mod-oauth2_3.2.2-1.${DISTRIB_CODENAME}+1_amd64.deb \
https://github.com/zmartzone/liboauth2/releases/download/v1.4.3/liboauth2_1.4.3-1.${DISTRIB_CODENAME}+1_amd64.deb
apt-get -y --no-install-recommends install \
./libapache2-mod-oauth2_3.2.2-1.${DISTRIB_CODENAME}+1_amd64.deb \
./liboauth2_1.4.3-1.${DISTRIB_CODENAME}+1_amd64.deb
a2enmod oauth2
rm -rfv \
./libapache2-mod-oauth2_3.2.2-1.${DISTRIB_CODENAME}+1_amd64.deb \
./liboauth2_1.4.3-1.${DISTRIB_CODENAME}+1_amd64.deb
apt-get purge -y wget
fi
fi