From 0c3df272a53b4f1be29a8c9a29f2b80ffc0203b8 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 17 Sep 2019 20:40:39 +0200 Subject: added helper script for vault handling --- vault.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 vault.sh (limited to 'vault.sh') diff --git a/vault.sh b/vault.sh new file mode 100755 index 00000000..1dd48155 --- /dev/null +++ b/vault.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +if [ -z "$1" ] || [ -z "$2" ]; then + echo "$0 " + exit 1 +fi +command="$1" +shift +file="$1" +shift + +file=$(realpath --relative-to "${BASH_SOURCE%/*}" "$file") +env_group=${file%%/*} + +cd "${BASH_SOURCE%/*}" +source common/utils.sh +vault_environment__set "$env_group" || exit 1 + +exec ansible-vault "$command" "$file" -- cgit v1.2.3