Optimize devstack plugin

For fixing the issue that mongodb in not in ubuntu 22.04 release, we need
to give a work-around way to install mongodb successfully in 22.04.

Change-Id: I5bb488f33d1c24298bb96e2702d2c98415db6cf4
This commit is contained in:
wanghao 2023-01-28 11:10:25 +08:00
parent 8049697fc9
commit 6b34431779
1 changed files with 13 additions and 8 deletions

View File

@ -188,14 +188,19 @@ function configure_mongodb {
pip_install pymongo
if is_ubuntu; then
# NOTE: To fix the mongodb's issue in ubuntu 22.04 LTS
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt update
curl -LO http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
sudo dpkg -i ./libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
install_package mongodb-org
restart_service mongod
ubuntu_version=`cat /etc/issue | cut -d " " -f2`
if [[ $ubuntu_version > '22' ]]; then
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt update
curl -LO http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
sudo dpkg -i ./libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
install_package mongodb-org
restart_service mongod
else
install_package mongodb-server
restart_service mongodb
fi
elif is_fedora; then
install_package mongodb
install_package mongodb-server