1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
fedihub-ansible/bin/extra_opts.sh
2020-10-09 16:50:47 +05:00

24 lines
495 B
Bash

FILE=$(readlink -f "$0")
DIR=$(dirname "$FILE")
ROOT=$(dirname "$DIR")
if [ ! -f "$ROOT/admin" ]; then
>&2 echo 'error: admin is not specified'
exit 1
fi
admin="$(cat "$ROOT/admin")"
if [ -z "$admin" ]; then
>&2 echo 'error: admin is not specified'
exit 1
fi
extra_opts="--extra-vars admin=$admin"
for vault_id in kotovalexarian xuhcc postgres matrix
do
if [ -f "$ROOT/secrets/$vault_id" ]; then
extra_opts="$extra_opts --vault-id $vault_id@$ROOT/secrets/$vault_id"
fi
done