Scripts to link ansible-vault and keychain. Keychain username is set to a git remote URL in git@ format if it could be determined, otherwize current system path is used instead.
git clone https://github.com/gitinsky/vaultkeychain.git
ln -vs "$PWD/vaultkeychain/vaultkeychain.py" ~/sbin/vaultkeychain
Or for shell version:
ln -vs "$PWD/vaultkeychain/vaultkeychain.sh" ~/sbin/vaultkeychain
[defaults]
vault_password_file = ~/sbin/vaultkeychain
Run
PAGER=cat ansible-vault view vaulted.yml
Password is vaultkeychain
.
On the second run password should be retreived from your keychain.
export ANSIBLE_VAULT_PASSWORD_FILE=~/sbin/vaultkeychain