blob: 0a513b1d1e1c5fb6f472c4b976c81b29fb683798 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#!/bin/bash
if [ -z "$1" ] || [ -z "$2" ]; then
echo "$0 <host(s)> <role>"
exit 1
fi
hosts="$1"
role="$2"
shift 2
cd "${BASH_SOURCE%/*}"
source common/utils.sh
ansible_variable__get env_group "$hosts" || exit 1
vault_environment__set "$env_group" || exit 1
echo "######## applying the role '$role' to host(s) '$hosts' in environment '$env_group' ########"
exec ansible-playbook -e "myhosts=$hosts" -e "myrole=$role" $@ "$env_group/generic.yaml"
|