add recovery vault password from bitwarden

This commit is contained in:
vincent 2021-03-14 20:24:53 +01:00
parent a2e9a67a04
commit 5f03388156
2 changed files with 8 additions and 1 deletions

View File

@ -3,7 +3,7 @@
## commande ansible ## commande ansible
***launch playbook on staging*** ***launch playbook on staging***
`ansible-playbook -i staging site.yml --vault-password-file=.vaultpassword` `ansible-playbook -i staging site.yml --vault-password-file=./ansible-vault-pass.sh
***init new role architecture*** ***init new role architecture***
`ansible-galaxy user_config init ` `ansible-galaxy user_config init `

7
ansible-vault-pass.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
BW_VAULT_ENTRY_ID="ansible vault"
if [[ -z ${BW_SESSION:-} ]] ; then
>&2 echo '$BW_SESSION not found! - You need to login to the vault'
BW_SESSION=$(bw unlock --raw)
fi
bw get password ${BW_VAULT_ENTRY_ID} --session ${BW_SESSION} --raw