summaryrefslogtreecommitdiff
path: root/run-playbook.sh
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-01-11 01:36:41 +0100
committerChristian Pointner <equinox@spreadspace.org>2020-01-11 01:36:41 +0100
commite88bb0e53b51f0077783ea34383080c3607994cc (patch)
treeaf7a6fe9a7ea30c42cf42c16977ec8833972e123 /run-playbook.sh
parenthelper scripts: optimize argument shifts (diff)
added playbook run script
Diffstat (limited to 'run-playbook.sh')
-rwxr-xr-xrun-playbook.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/run-playbook.sh b/run-playbook.sh
new file mode 100755
index 00000000..6bdd1fb1
--- /dev/null
+++ b/run-playbook.sh
@@ -0,0 +1,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"