installing dependencies

This commit is contained in:
faten 2025-04-22 09:00:08 +00:00
parent 5722db51a9
commit 473f7875f2

View File

@ -7,63 +7,9 @@
set -o pipefail
echo "[*] Kernel Information:"
uname -a
echo
echo "[*] Checking for /etc/os-release:"
if [ -f /etc/os-release ]; then
cat /etc/os-release
else
echo " /etc/os-release not found."
fi
echo
echo "[*] Checking for other release files:"
for f in /etc/redhat-release /etc/centos-release /etc/debian_version /etc/alpine-release; do
if [ -f "$f" ]; then
echo " Found $f:"
cat "$f"
fi
done
echo
echo "[*] Checking available package managers:"
for pm in apt apt-get yum dnf apk; do
if command -v $pm &> /dev/null; then
echo " Found command: $pm"
fi
done
echo
echo "[*] Checking Python version (if available):"
if command -v python3 &> /dev/null; then
python3 --version
elif command -v python &> /dev/null; then
python --version
else
echo " Python not found."
fi
echo
echo "[*] Current PATH:"
echo "$PATH"
echo
# --- Installation des dépendances ---
echo "--- Installation des dépendances (OpenStack Client, jq) ---"
if command -v sudo &> /dev/null && command -v apt-get &> /dev/null; then
echo "Attempting installation using apt-get..."
sudo apt-get update -y || echo "WARN: apt-get update failed, continuing..."
sudo apt-get install -y python3-openstackclient jq || { echo "ERREUR: Failed to install packages."; exit 1; }
echo "Installation attempt finished."
else
echo "WARN: sudo or apt-get not found. Assuming dependencies are pre-installed."
fi
echo "--- Installation des dépendances Alpine (OpenStack Client, jq) ---"
apk add --no-cache py3-openstackclient jq || { echo "ERREUR: apk add a échoué."; exit 1; }
echo "--- Fin Installation Alpine ---"
echo ">>>>>> DEBUG: Liste des variables d'environnement reçues par le script <<<<<<"
@ -179,3 +125,4 @@ echo "--- Création du projet OpenStack terminée avec succès ---"
echo "ID du Projet OpenStack: ${PROJECT_ID}"
exit 0