summaryrefslogtreecommitdiff
path: root/apply-role.sh
blob: a4b49b044bab66c2345a8085450841eaa65496fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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