Add vault

This commit is contained in:
2024-04-13 19:06:43 +02:00
parent 8e59ebca27
commit 62ddf8f42a
3 changed files with 17 additions and 1 deletions

10
scripts/env.sh Executable file
View File

@@ -0,0 +1,10 @@
response=`curl -X 'GET' "https://$VAULT_HOST/v1/$VAULT_SECRET_PATH" -s \
-H 'accept: application/json' \
-H "X-Vault-Token: $VAULT_TOKEN"`
data=`echo $response | jq -r '.data.data'`
for key in $(echo "$data" | jq -r 'keys[]'); do
value=$(echo "$data" | jq -r ".\"$key\"") # Corrected syntax
echo "$key"="$value"
done