Per http://docs.ansible.com/ansible/playbooks_vault.html you can set an environment variable to use a password file for vault access. We can use this to create an environment variable to hold the password.
Copy vault-env
from this project to ~/bin
. Then add this to your ~/.bashrc
:
export ANSIBLE_VAULT_PASSWORD_FILE=~/bin/vault-env
Now just export your password in your shell as needed. Don't be a douche and put this in your profile though.
export ANSIBLE_VAULT_PASSWORD=<password>
Don't forget to make
vault-env
executablechmod +x ~/bin/vault-env