summaryrefslogtreecommitdiff
path: root/apply-role.sh
blob: 3d39f3454a7f33412a058503db38da876280e5ff (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 "myhosts=$hosts" -e "myrole=$role" $@ generic.yaml