feat(cicd): Use Proxmox API instead of SSH for LINSTOR management
Some checks failed
CD - Deploy Infrastructure / Terraform Validation (push) Successful in 16s
CD - Deploy Infrastructure / Deploy on pve1 (push) Failing after 16s
CD - Deploy Infrastructure / Deploy on pve2 (push) Failing after 14s
CD - Deploy Infrastructure / Deploy on pve3 (push) Successful in 1m56s
CD - Deploy Infrastructure / Validate K3s Cluster (push) Has been skipped
CD - Deploy Infrastructure / Deployment Notification (push) Failing after 1s
Some checks failed
CD - Deploy Infrastructure / Terraform Validation (push) Successful in 16s
CD - Deploy Infrastructure / Deploy on pve1 (push) Failing after 16s
CD - Deploy Infrastructure / Deploy on pve2 (push) Failing after 14s
CD - Deploy Infrastructure / Deploy on pve3 (push) Successful in 1m56s
CD - Deploy Infrastructure / Validate K3s Cluster (push) Has been skipped
CD - Deploy Infrastructure / Deployment Notification (push) Failing after 1s
Version 2.0 du script de gestion LINSTOR Changements majeurs: - Remplace les commandes SSH/LINSTOR par l'API Proxmox REST - Ajoute une classe ProxmoxAPI pour gérer les appels API - Utilise les endpoints /cluster/linstor/* de l'API Proxmox - Installe les dépendances Python (requests, urllib3) dans le pipeline - Passe les credentials API via variables d'environnement/secrets - Plus sécurisé: pas besoin de clés SSH, utilise les tokens API existants - Support des certificats auto-signés (verify_ssl=False) Auteur: BENE Maël
This commit is contained in:
parent
287410732f
commit
4628fc266f
2 changed files with 205 additions and 134 deletions
|
|
@ -81,14 +81,19 @@ jobs:
|
|||
if ! command -v tofu &> /dev/null; then
|
||||
curl -fsSL https://get.opentofu.org/install-opentofu.sh | bash -s -- --install-method standalone --opentofu-version 1.10.7
|
||||
fi
|
||||
- name: Setup Python
|
||||
- name: Setup Python and dependencies
|
||||
run: |
|
||||
apt-get update && apt-get install -y python3
|
||||
apt-get update && apt-get install -y python3 python3-pip
|
||||
pip3 install --break-system-packages requests urllib3
|
||||
- name: Prepare LINSTOR resources for pve1
|
||||
run: |
|
||||
# Exécute le script dans le container, qui utilisera SSH pour communiquer avec LINSTOR
|
||||
# Utilise l'IP au lieu du hostname car le container Docker ne peut pas résoudre les noms locaux
|
||||
python3 scripts/manage_linstor_resources.py --terraform-dir terraform --remote-host 192.168.100.30 --verbose
|
||||
# Exécute le script dans le container, qui utilisera l'API Proxmox pour gérer LINSTOR
|
||||
python3 scripts/manage_linstor_resources.py \
|
||||
--terraform-dir terraform \
|
||||
--api-url "${{ secrets.PROXMOX_API_URL || 'https://192.168.100.10:8006/api2/json' }}" \
|
||||
--token-id "${{ secrets.PROXMOX_TOKEN_ID }}" \
|
||||
--token-secret "${{ secrets.PROXMOX_TOKEN_SECRET }}" \
|
||||
--verbose
|
||||
- name: Terraform Apply on pve1
|
||||
run: |
|
||||
cd terraform/pve1
|
||||
|
|
@ -124,14 +129,19 @@ jobs:
|
|||
if ! command -v tofu &> /dev/null; then
|
||||
curl -fsSL https://get.opentofu.org/install-opentofu.sh | bash -s -- --install-method standalone --opentofu-version 1.10.7
|
||||
fi
|
||||
- name: Setup Python
|
||||
- name: Setup Python and dependencies
|
||||
run: |
|
||||
apt-get update && apt-get install -y python3
|
||||
apt-get update && apt-get install -y python3 python3-pip
|
||||
pip3 install --break-system-packages requests urllib3
|
||||
- name: Prepare LINSTOR resources for pve2
|
||||
run: |
|
||||
# Exécute le script dans le container, qui utilisera SSH pour communiquer avec LINSTOR
|
||||
# Utilise l'IP au lieu du hostname car le container Docker ne peut pas résoudre les noms locaux
|
||||
python3 scripts/manage_linstor_resources.py --terraform-dir terraform --remote-host 192.168.100.30 --verbose
|
||||
# Exécute le script dans le container, qui utilisera l'API Proxmox pour gérer LINSTOR
|
||||
python3 scripts/manage_linstor_resources.py \
|
||||
--terraform-dir terraform \
|
||||
--api-url "${{ secrets.PROXMOX_API_URL || 'https://192.168.100.10:8006/api2/json' }}" \
|
||||
--token-id "${{ secrets.PROXMOX_TOKEN_ID }}" \
|
||||
--token-secret "${{ secrets.PROXMOX_TOKEN_SECRET }}" \
|
||||
--verbose
|
||||
- name: Terraform Apply on pve2
|
||||
run: |
|
||||
cd terraform/pve2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue