Correction du script de création des hôtes dans le cluster
Il n'est plus possible d'utiliser ssh-copy-id, mise en place de la méthode proposée par Daniel dans la demande pour la copie des clés sans utiliser ssh-copy-id. Modification de la commande de création des noeuds dans ONE, l'option "-n" n'existe plus. ref #17465 @2h (Contribution Cadoles)
This commit is contained in:
parent
5985b56e46
commit
95a74c0f0a
|
@ -14,7 +14,17 @@
|
||||||
function copy_ssh_id()
|
function copy_ssh_id()
|
||||||
{
|
{
|
||||||
local ip=${1}
|
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
|
# 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 \"$(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}")
|
ret=$(su - ${ONEUSER} -c -- "${cmd}")
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
@ -105,6 +115,8 @@ do
|
||||||
EchoVert " * Gestion des clés SSH"
|
EchoVert " * Gestion des clés SSH"
|
||||||
echo
|
echo
|
||||||
copy_ssh_id ${HAPY_SLV_IP[${i}]}
|
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"
|
EchoVert " * Enregistrement du noeud"
|
||||||
register_node ${HAPY_SLV[${i}]}
|
register_node ${HAPY_SLV[${i}]}
|
||||||
wait_node_ok ${HAPY_SLV[${i}]}
|
wait_node_ok ${HAPY_SLV[${i}]}
|
||||||
|
|
Loading…
Reference in New Issue