Add encrypting helper

This commit is contained in:
Luke Murphy 2020-03-21 01:00:50 +01:00
parent d55edd7ddd
commit bf5d867414
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

16
sbin/encrypt.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
set -eu -o pipefail
# Usage
# ./encrypt.sh mysecretname mysecretvalue
declare name="$1"
declare secret="$2"
ansible-vault \
encrypt_string \
--vault-password-file ansible/.vault.sh \
--name \
"$name" \
"$secret"