blob: 1dd48155b688527598d0a719e9a0bec8a7b9453b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#!/bin/bash
if [ -z "$1" ] || [ -z "$2" ]; then
echo "$0 <command> <file>"
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"
|