File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
data/data/agent/files/usr/local/bin Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,6 @@ printf '\nInfra env id is %s\n' "${INFRA_ENV_ID}" 1>&2
2020
2121status_issue=" 90_add-node"
2222
23- # For some reason the initial role patching doesn't seem to work properly
24- echo " Patching host..."
25- HOST_ID=$( curl -s " ${BASE_URL} /infra-envs/${INFRA_ENV_ID} /hosts" | jq -r ' .[].id' )
26- curl -X PATCH -d ' {"host_role":"worker"}' -H " Content-Type: application/json" " ${BASE_URL} /infra-envs/${INFRA_ENV_ID} /hosts/${HOST_ID} "
27-
2823# Wait for the current host to be ready
2924host_ready=false
3025while [[ $host_ready == false ]]
3833 fi
3934done
4035
36+ HOST_ID=$( curl -s " ${BASE_URL} /infra-envs/${INFRA_ENV_ID} /hosts" | jq -r ' .[].id' )
37+ printf ' \nHost %s is ready for installation\n' " ${HOST_ID} " 1>&2
4138clear_issue " ${status_issue} "
4239
43- sleep 1m
44-
4540# Add the current host to the cluster
46- curl -X POST -s -S " ${BASE_URL} /infra-envs/${INFRA_ENV_ID} /hosts/${HOST_ID} /actions/install"
47- echo " Host installation started" 1>&2
41+ res=$( curl -X POST -s -S " ${BASE_URL} /infra-envs/${INFRA_ENV_ID} /hosts/${HOST_ID} /actions/install" )
42+ code=$( echo " $res " | jq -r ' .code' )
43+ message=$( echo " $res " | jq -r ' .message' )
44+ if [[ $res = " 200" ]]; then
45+ printf " \nHost installation started\n" 1>&2
46+ else
47+ printf ' \nHost installation failed: %s\n' " ${message} " 1>&2
48+ fi
You can’t perform that action at this time.
0 commit comments