summaryrefslogtreecommitdiff
path: root/common/utils.sh
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-04-23 04:59:13 +0200
committerChristian Pointner <equinox@spreadspace.org>2020-04-23 04:59:13 +0200
commit9d9d4fdc70ec0ac276f3795f5ccea39d6b94b995 (patch)
tree72ebbbbb00cfea15039663a765c8372a8b3c04e9 /common/utils.sh
parentrefactor all install roles ans playbooks to work with new variable install_ho... (diff)
further cleanup host bootstraping
Diffstat (limited to 'common/utils.sh')
-rw-r--r--common/utils.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/utils.sh b/common/utils.sh
index 262926c7..bb14381e 100644
--- a/common/utils.sh
+++ b/common/utils.sh
@@ -19,8 +19,8 @@ ansible_variable__get() {
local _var_name="$1"
local _hosts="$2"
- local _result=$(env ANSIBLE_STDOUT_CALLBACK="json" ansible "$_hosts" -m debug -a "var=$_var_name" | \
- jq -r ".plays[].tasks[].hosts[].$_var_name" | sort | uniq)
+ local _result=$(env ANSIBLE_STDOUT_CALLBACK="json" ansible "$_hosts" -m debug -a "msg={{ $_var_name }}" | \
+ jq -r '.plays[].tasks[].hosts[] | select(.failed != true) | .msg' | sort | uniq)
if [ $? -ne 0 ] || [ -z "$_result" ]; then
print_error "failed to get value of variable '$_var_name' for host(s) '$_hosts'"
return 1