#!/bin/bash if [ -z "$1" ] || [ -z "$2" ]; then echo "$0 " 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.yml"