Skip to content

Instantly share code, notes, and snippets.

@rpkamp
Created January 8, 2018 09:02
Show Gist options
  • Save rpkamp/78f9cb979faffb89acbfed41139dcc7c to your computer and use it in GitHub Desktop.
Save rpkamp/78f9cb979faffb89acbfed41139dcc7c to your computer and use it in GitHub Desktop.
Git pre-commit file to make sure ansible vaults are encypted
#!/bin/bash
for f in ansible/vars/*
do
LINE=$(head -n 1 $f)
if [ "$LINE" != "\$ANSIBLE_VAULT;1.1;AES256" ]; then
echo "File "$f" is not a valid ansible vault!"
exit 1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment