diff --git a/README.md b/README.md index ac956d1..cf54350 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## commande ansible ***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*** `ansible-galaxy user_config init ` diff --git a/ansible-vault-pass.sh b/ansible-vault-pass.sh new file mode 100755 index 0000000..d739c2a --- /dev/null +++ b/ansible-vault-pass.sh @@ -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