-
-
Save thomasbilk/f3a6f7700e1ca0007c0667dd3414889d to your computer and use it in GitHub Desktop.
Ansible vault transparent encryption revisited
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/sh | |
tmp=`mktemp` | |
cat "${1--}" > $tmp | |
ansible-vault decrypt $tmp > /dev/null 2>&1 | |
if [ $? -eq 0 ]; then | |
cat "$tmp" | |
else | |
cat "${1--}" | |
fi | |
rm $tmp |
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/sh | |
tmp=`mktemp` | |
cat "${1--}" > $tmp | |
ansible-vault encrypt $tmp > /dev/null 2>&1 | |
if [ $? -eq 0 ]; then | |
cat "$tmp" | |
else | |
cat "${1--}" | |
fi | |
rm $tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment