summaryrefslogtreecommitdiff
path: root/apply-role.sh
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2017-11-21 22:28:39 +0100
committerChristian Pointner <equinox@spreadspace.org>2017-11-21 22:28:39 +0100
commit91cd5480b5a1ca1103d5e239af3d331477c41c2c (patch)
treeb495bf31e2d5da50b045838a1e8d0455db09ee65 /apply-role.sh
initial commit as copy from helsinki ansible repo
Diffstat (limited to 'apply-role.sh')
-rwxr-xr-xapply-role.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/apply-role.sh b/apply-role.sh
new file mode 100755
index 00000000..a4b49b04
--- /dev/null
+++ b/apply-role.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+if [ -z "$1" ] || [ -z "$2" ] ; then
+ echo "$0 <host(s)> <role>"
+ exit 1
+fi
+hosts="$1"
+shift
+role="$1"
+shift
+
+echo "######## applying the role '$role' to host(s) '$hosts' ########"
+exec ansible-playbook -e "myname=$hosts" -e "myrole=$role" $@ generic.yaml