Skip to content

Support setting vault password file from environment variable #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tommarshall opened this issue Aug 17, 2016 · 0 comments
Open

Comments

@tommarshall
Copy link
Owner

Ansible Vault allows the vault password file to be set with an environment variable. git-diff-ansible-vault should do the same.

http://docs.ansible.com/ansible/playbooks_vault.html#running-a-playbook-with-vault

You can also set ANSIBLE_VAULT_PASSWORD_FILE environment variable, e.g. ANSIBLE_VAULT_PASSWORD_FILE=~/.vault_pass.txt and Ansible will automatically search for the password in that file.

@tommarshall tommarshall changed the title Support setting --vault-password-file from environment variable Support setting vault password file from environment variable Aug 17, 2016
tommarshall added a commit that referenced this issue Oct 26, 2016
Because:

* Ansible Vault allows the vault password file to be set with a
  `ANSIBLE_VAULT_PASSWORD_FILE` environment variable.
  `git-diff-ansible-vault` should do the same, ref:
  http://docs.ansible.com/ansible/playbooks_vault.html#running-a-playbook-with-vault

This change:

* Use `ANSIBLE_VAULT_PASSWORD_FILE` environment variable for vault path
  if it's value exists as file.
* `--vault-password-file` takes precedence if set, same as it does for
  `ansible-vault`.

Fixes #9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant