From 95a74c0f0a8425d5d631eeb33a555cb8b4f8d51c Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Fri, 14 Oct 2016 15:57:04 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20du=20script=20de=20cr=C3=A9ation?= =?UTF-8?q?=20des=20h=C3=B4tes=20dans=20le=20cluster?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- scripts/onehost_create_all | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/onehost_create_all b/scripts/onehost_create_all index 0efa546..d26d72c 100755 --- a/scripts/onehost_create_all +++ b/scripts/onehost_create_all @@ -14,7 +14,17 @@ function copy_ssh_id() { local ip=${1} - su - ${ONEUSER} -c "ssh-copy-id ${ip}" + + ssh ${ip} bash -s < /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}]}