summaryrefslogtreecommitdiff
path: root/apply-role.sh
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2018-12-08 21:11:19 +0100
committerChristian Pointner <equinox@spreadspace.org>2018-12-08 21:11:19 +0100
commit57cc6098cf6315b0c2fee544c94d43d2a47bbfa4 (patch)
tree3f8031db65b81c69a2c619c66d1fdcf546542c8d /apply-role.sh
parentvault readme is outdated (diff)
further improve script helpers
Diffstat (limited to 'apply-role.sh')
-rwxr-xr-xapply-role.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/apply-role.sh b/apply-role.sh
index 5af348d4..708a8357 100755
--- a/apply-role.sh
+++ b/apply-role.sh
@@ -9,11 +9,10 @@ shift
role="$1"
shift
-source "${BASH_SOURCE%/*}/common/utils.sh"
-get_ansible_variable env_group "$hosts"
-if [ $? -ne 0 ]; then
- exit 1
-fi
+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"