ci: fix credentials for tofu test stage
All checks were successful
development / Check commit compliance (push) Successful in 4s
pull-requests-open / Check commit compliance (pull_request) Successful in 4s
pull-requests-open / Check pre-commit status (pull_request) Successful in 13s
pull-requests-open / Run E2E tofu tests (pull_request) Successful in 2m52s

This commit is contained in:
Bertrand Lanson 2024-09-10 18:55:49 +02:00
parent 7a8ff6341a
commit ce9b851217
Signed by: lanson
SSH Key Fingerprint: SHA256:/nqc6HGqld/PS208F6FUOvZlUzTS0rGpNNwR5O2bQBw
2 changed files with 20 additions and 3 deletions

View File

@ -97,10 +97,22 @@ jobs:
with: with:
tofu_version: 1.8.2 tofu_version: 1.8.2
- name: Get secrets from vault
id: import-secrets
uses: hashicorp/vault-action@v3
with:
url: "https://vault.ednz.fr"
method: approle
roleId: ${{ secrets.VAULT_APPROLE_ID }}
secretId: ${{ secrets.VAULT_APPROLE_SECRET_ID }}
secrets: |
kv/data/cicd/vault/infrabuilder approle_id | VAULT_INFRABUILDER_APPROLE_ID ;
kv/data/cicd/vault/infrabuilder approle_secret_id | VAULT_INFRABUILDER_APPROLE_SECRET_ID ;
- name: Get required credentials - name: Get required credentials
id: tofu-auth id: tofu-auth
run: | run: |
VAULT_TOKEN=$(curl --silent --request POST --data '{"role_id": "${{ secrets.VAULT_APPROLE_ID }}","secret_id": "${{ secrets.VAULT_APPROLE_SECRET_ID }}"}' https://vault.ednz.fr/v1/auth/approle/login | jq -r .auth.client_token) VAULT_TOKEN=$(curl --silent --request POST --data '{"role_id": "${{ steps.import-secrets.outputs.VAULT_INFRABUILDER_APPROLE_ID }}","secret_id": "${{ steps.import-secrets.outputs.VAULT_INFRABUILDER_APPROLE_SECRET_ID }}"}' https://vault.ednz.fr/v1/auth/approle/login | jq -r .auth.client_token)
echo "vault_token=$VAULT_TOKEN" >> $GITHUB_OUTPUT echo "vault_token=$VAULT_TOKEN" >> $GITHUB_OUTPUT
- name: Tofu init - name: Tofu init

View File

@ -1,6 +1,11 @@
# terraform-openstack-lz # terraform-openstack-landing-zone
Terraform/OpenTofu module to deploy a completely customizable OpenStack network architecture.
![Terraform Badge](https://img.shields.io/badge/Terraform-844FBA?logo=terraform&logoColor=fff&style=for-the-badge)
![OpenTofu Badge](https://img.shields.io/badge/OpenTofu-FFDA18?logo=opentofu&logoColor=000&style=for-the-badge)
![OpenStack Badge](https://img.shields.io/badge/OpenStack-ED1944?logo=openstack&logoColor=fff&style=for-the-badge)
Terraform module to deploy a completely customizable OpenStack
<!-- BEGIN_TF_DOCS --> <!-- BEGIN_TF_DOCS -->
### Requirements ### Requirements