diff options
Diffstat (limited to 'gpg/get-vault-pass.sh')
-rwxr-xr-x | gpg/get-vault-pass.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gpg/get-vault-pass.sh b/gpg/get-vault-pass.sh index 6cf2ff9a..5c295fd0 100755 --- a/gpg/get-vault-pass.sh +++ b/gpg/get-vault-pass.sh @@ -6,7 +6,12 @@ fi NAME="$1" shift -gpg2 --decrypt --batch --no-tty --quiet < "${BASH_SOURCE%/*}/vault-pass-$NAME.gpg" +BIN=$(which gpg2) +if [ $? -ne 0 ]; then + BIN=$(which gpg) +fi + +$BIN --decrypt --batch --no-tty --quiet < "${BASH_SOURCE%/*}/vault-pass-$NAME.gpg" # Ansible up to including 2.6 seems to have a bug which ignores the setting of 'vault_id_match = True' # in ansible.cfg (or the equivalent environment variable). |