fix: Erreurs workflow CI (OpenTofu, sudo)

This commit is contained in:
Tellsanguis 2025-11-07 10:08:20 +01:00
parent 40dc0f4184
commit bdfcaf5f46

View file

@ -16,7 +16,7 @@ jobs:
- name: Setup OpenTofu - name: Setup OpenTofu
run: | run: |
if ! command -v tofu &> /dev/null; then if ! command -v tofu &> /dev/null; then
curl -fsSL https://get.opentofu.org/install-opentofu.sh | bash curl -fsSL https://get.opentofu.org/install-opentofu.sh | bash -s -- --install-method standalone
fi fi
- name: Terraform Format Check - name: Terraform Format Check
@ -62,8 +62,8 @@ jobs:
- name: Install Ansible - name: Install Ansible
run: | run: |
if ! command -v ansible &> /dev/null; then if ! command -v ansible &> /dev/null; then
sudo apt-get update apt-get update
sudo apt-get install -y ansible apt-get install -y ansible
fi fi
- name: Ansible Syntax Check - name: Ansible Syntax Check
@ -97,7 +97,7 @@ jobs:
run: | run: |
if ! command -v kubectl &> /dev/null; then if ! command -v kubectl &> /dev/null; then
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
fi fi
- name: Validate Kubernetes Manifests - name: Validate Kubernetes Manifests
@ -110,7 +110,7 @@ jobs:
if ! command -v kubeconform &> /dev/null; then if ! command -v kubeconform &> /dev/null; then
wget https://github.com/yannh/kubeconform/releases/latest/download/kubeconform-linux-amd64.tar.gz wget https://github.com/yannh/kubeconform/releases/latest/download/kubeconform-linux-amd64.tar.gz
tar xf kubeconform-linux-amd64.tar.gz tar xf kubeconform-linux-amd64.tar.gz
sudo mv kubeconform /usr/local/bin/ mv kubeconform /usr/local/bin/
fi fi
- name: Kubeconform Validation - name: Kubeconform Validation
@ -128,10 +128,10 @@ jobs:
- name: Install Trivy - name: Install Trivy
run: | run: |
if ! command -v trivy &> /dev/null; then if ! command -v trivy &> /dev/null; then
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add - wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | apt-key add -
echo "deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list echo "deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update apt-get update
sudo apt-get install -y trivy apt-get install -y trivy
fi fi
- name: Run Trivy IaC Scan - name: Run Trivy IaC Scan