fix: ssh check would fail and not warn the user
Signed-off-by: Devin Buhl <devin.kray@gmail.com>
This commit is contained in:
1 file changed
+3
-4
+3
-4
@@ -223,12 +223,11 @@ verify_ansible_hosts() {
|
|||||||
_has_envar "${node_password}"
|
_has_envar "${node_password}"
|
||||||
_has_envar "${node_control}"
|
_has_envar "${node_control}"
|
||||||
|
|
||||||
test="$(ssh -q -o BatchMode=yes -o ConnectTimeout=5 "${!node_username}"@"${!var}" echo ok 2>&1)"
|
if ssh -q -o BatchMode=yes -o ConnectTimeout=5 "${!node_username}"@"${!var}" "true"; then
|
||||||
if [[ "${test}" != "ok" ]]; then
|
_log "INFO" "Successfully SSH'ed into host '${!var}' with username '${!node_username}'"
|
||||||
|
else
|
||||||
_log "ERROR" "Unable to SSH into host '${!var}' with username '${!node_username}'"
|
_log "ERROR" "Unable to SSH into host '${!var}' with username '${!node_username}'"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
|
||||||
_log "INFO" "Successfully SSH'ed into host '${!var}' with username '${!node_username}'"
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user