sync host

This commit is contained in:
Emmanuel Garette 2019-02-25 11:52:47 +01:00
parent bc05faa091
commit b06123cc04
1 changed files with 17 additions and 1 deletions

View File

@ -39,6 +39,21 @@ function register_node()
return $?
}
# Fix host creation error from 5.6.1 with sync methode rsync
function sync_host()
{
CMD="onehost"
OPT="sync -f --rsync"
AUTH=$(get_one_auth)
res=$(su - oneadmin -c "${CMD} ${OPT} --user ${AUTH%:*} --password ${AUTH#*:}")
if [[ ${?} -ne 0 ]]
then
error "Hosts sync failed"
else
echo "Hosts sync OK"
fi
}
#
# NAME: wait_node_ok
# AIM: Wait until the node is OK or ERROR
@ -58,7 +73,7 @@ function wait_node_ok()
[[ ${st} == '' ]] && break
if [[ ${st} == "ERROR" ]]
then
RET=2
RET=50
break
fi
@ -122,6 +137,7 @@ for host in ${HAPY_SLV}; do
EchoVert " * Enregistrement du noeud"
register_node ${host}
sync_host ${host}
wait_node_ok ${host}
if [[ ${?} -ne 0 ]]
then