Created
July 4, 2018 11:50
-
-
Save zioproto/6aad9dc9ab9d24ba452f58045c251d27 to your computer and use it in GitHub Desktop.
Git hook to avoid committing a decrypted ansible vault
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git show :group_vars/all/vault | grep ^'$ANSIBLE_VAULT' | |
export encrypted=$? | |
if [ $encrypted -ne 0 ]; then | |
echo Ansible Vault not encrypted, refusing to commit | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment