#!/usr/bin/env bash
####Usage
# ./vault.sh encrypt
# ./vault.sh dencrypt
# ./vault.sh encrypt /full/path/to/file.yml
######
set -euo pipefail
cd `dirname $0`
if [ -z "$PASSWORD" ]; then
read -s -p "Enter Password: " PASSWORD
fi
VAULT_FILE=vault_key
echo "${PASSWORD}" > "${VAULT_FILE}"
ACTION=decrypt
if [ "$1" != "" ]; then
ACTION="$1"
fi
FILES=(group_vars/prod/*.yml)
if [ ! -z "${2-}" ]; then
FILES=("$2")
fi
for FILE in "${FILES[@]}"
do
if [ "${ACTION}" = "encrypt" ]; then
echo "Encrypting ${FILE}"
ansible-vault encrypt "${FILE}.decrypted" --output=$FILE --vault-password-file "${VAULT_FILE}"
else
echo "Decrypting ${FILE}"
ansible-vault decrypt $FILE --output="${FILE}.decrypted" --vault-password-file "${VAULT_FILE}"
fi
done
rm -rf "${VAULT_FILE}"
-
Ansible Golang Service
May 8, 2018 -
Varnish 5.1 always online
April 30, 2018 -
Install Solr as systemd with restart on failure
April 28, 2018 -
Varnish with secure AWS S3 bucket as backend
April 13, 2018 -
Setup postgreSQL RDS using Ansible
April 10, 2018 -
Cachita is a golang file and memory cache library
April 10, 2018 -
Ansible vault encrypt/decrypt shell script
April 10, 2018
-
canadian pharmacy viagra brand :
canadian pharmacies shipping to usa http://dfsawdfghjkxsas.com...
-
Google :
Google Here is an excellent Blog You might Obtain In...
-
Google :
Google Wonderful story, reckoned we could combine se...
-
Jeff Grundy :
uh oh. Latest WordPress update broke the script! :( Oh well, the searc...
-
Jeff Grundy :
This is awesome. Thanks a lot. Searched everywhere for something that ...
-
Ayshwarya Syndicate Souharda C :
Nice on thanks for the code...
-
Clipping Masking :
Great site!...
-
Theophilus Omoregbee :
This past saved the future lol, thanks mate...
-
John Booker :
Thanks for the coding ....
-
John Booker :
Great sharing , i need this for my business....