Merge branch '2.6.0/master'

This commit is contained in:
Philippe Caseiro 2016-10-14 16:15:43 +02:00
commit 899761e535

View File

@ -14,7 +14,17 @@
function copy_ssh_id()
{
local ip=${1}
su - ${ONEUSER} -c "ssh-copy-id ${ip}"
ssh ${ip} bash -s <<EOF
echo $(cat ~oneadmin/.ssh/id_rsa.pub) > /tmp/one-master.key.pub
if ! grep -qs /tmp/one-master.key.pub ~oneadmin/.ssh/authorized_keys
then
cat /tmp/one-master.key.pub >> ~oneadmin/.ssh/authorized_keys
chown oneadmin:oneadmin ~oneadmin/.ssh/authorized_keys
fi
rm -f /tmp/one-master.key.pub
EOF
return ${?}
}
#
@ -26,7 +36,7 @@ function register_node()
{
# ref https://dev-eole.ac-dijon.fr/issues/16797
#cmd="onehost create -i kvm -v kvm -n ovswitch -c \"$(CreoleGet one_cluster_name)\" ${1}"
cmd="onehost create -i kvm -v kvm -n ovswitch -c \"default\" ${1}"
cmd="onehost create -i kvm -v kvm -c \"default\" ${1}"
ret=$(su - ${ONEUSER} -c -- "${cmd}")
return $?
}
@ -105,6 +115,8 @@ do
EchoVert " * Gestion des clés SSH"
echo
copy_ssh_id ${HAPY_SLV_IP[${i}]}
[[ ${?} -ne 0 ]] && EchoRouge "Erreur lors de l'échange de clés SSH avec le noeud ${HAPY_SLV[${i}]}}"
EchoVert " * Enregistrement du noeud"
register_node ${HAPY_SLV[${i}]}
wait_node_ok ${HAPY_SLV[${i}]}