summaryrefslogtreecommitdiff
path: root/apply-role.sh
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2018-12-01 23:14:05 +0100
committerChristian Pointner <equinox@spreadspace.org>2018-12-01 23:14:05 +0100
commit17447210485bbe379beb9c7e9a3034e900110ed9 (patch)
tree1b911eed4ea5bce52a5bc24f0951dfe200ea3217 /apply-role.sh
parentfixed acmetool self-signed cert handling (diff)
moved to multi environment repo structure
Diffstat (limited to 'apply-role.sh')
-rwxr-xr-xapply-role.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/apply-role.sh b/apply-role.sh
index 3d39f345..a2b0ac4f 100755
--- a/apply-role.sh
+++ b/apply-role.sh
@@ -1,13 +1,15 @@
#!/bin/bash
-if [ -z "$1" ] || [ -z "$2" ] ; then
- echo "$0 <host(s)> <role>"
+if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] ; then
+ echo "$0 <environment> <host(s)> <role>"
exit 1
fi
+env="$1"
+shift
hosts="$1"
shift
role="$1"
shift
-echo "######## applying the role '$role' to host(s) '$hosts' ########"
-exec ansible-playbook -e "myhosts=$hosts" -e "myrole=$role" $@ generic.yaml
+echo "######## applying the role '$role' to host(s) '$hosts' in environment '$env' ########"
+exec ansible-playbook -e "myhosts=$hosts" -e "myrole=$role" $@ "$env/generic.yaml"