summaryrefslogtreecommitdiff
path: root/apply-role.sh
diff options
context:
space:
mode:
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 0000000..3d39f34
--- /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 "myhosts=$hosts" -e "myrole=$role" $@ generic.yaml