1
1
Fork 0
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2024-05-07 08:06:32 +02:00
infrastructure/misc/vault-keyring-client.sh
Evangelos Foutras 511b6ca4e1
misc/vault-keyring-client.sh: add flock workaround
Otherwise running terraform under tf-stage2 will often fail with:

> ansible.errors.AnsibleError: Vault password client script
> ../misc/vault-keyring-client.sh did not find a secret for
> vault-id=default: b'gpg: decryption failed: No secret key\n'
2022-05-09 23:12:48 +03:00

9 lines
333 B
Bash
Executable File

#!/bin/sh
readonly vault_password_file_encrypted="$(dirname $0)/vault-$2-password.gpg"
# often getting "gpg: decryption failed: No secret key" in tf-stage2
# seems to work with flock (issue last reproduced with gnupg 2.2.35)
flock "$vault_password_file_encrypted" \
gpg --batch --decrypt --quiet "$vault_password_file_encrypted"