sync host
This commit is contained in:
parent
bc05faa091
commit
b06123cc04
@ -39,6 +39,21 @@ function register_node()
|
|||||||
return $?
|
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
|
# NAME: wait_node_ok
|
||||||
# AIM: Wait until the node is OK or ERROR
|
# AIM: Wait until the node is OK or ERROR
|
||||||
@ -58,7 +73,7 @@ function wait_node_ok()
|
|||||||
[[ ${st} == '' ]] && break
|
[[ ${st} == '' ]] && break
|
||||||
if [[ ${st} == "ERROR" ]]
|
if [[ ${st} == "ERROR" ]]
|
||||||
then
|
then
|
||||||
RET=2
|
RET=50
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -122,6 +137,7 @@ for host in ${HAPY_SLV}; do
|
|||||||
|
|
||||||
EchoVert " * Enregistrement du noeud"
|
EchoVert " * Enregistrement du noeud"
|
||||||
register_node ${host}
|
register_node ${host}
|
||||||
|
sync_host ${host}
|
||||||
wait_node_ok ${host}
|
wait_node_ok ${host}
|
||||||
if [[ ${?} -ne 0 ]]
|
if [[ ${?} -ne 0 ]]
|
||||||
then
|
then
|
||||||
|
Loading…
Reference in New Issue
Block a user