summaryrefslogtreecommitdiff
path: root/run-playbook.sh
blob: 6bdd1fb1739059479612598224f058dd0303f095 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

if [ -z "$1" ]; then
  echo "$0 <env-group/playbook.yml>"
  exit 1
fi
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-playbook $@ "$file"