diff --git a/scripts/onehost_create_all b/scripts/onehost_create_all index 746fce7..2f91908 100755 --- a/scripts/onehost_create_all +++ b/scripts/onehost_create_all @@ -31,6 +31,12 @@ EOF fi } +function copy_files() +{ + local host=${1} + su - oneadmin -c "scp ~oneadmin/.one/* ${host}:oneadmin/.one/" +} + # # NAME: register_node # AIM: register the node in OpenNebula master @@ -138,11 +144,10 @@ then exit 1 fi -follower=1 master=1 if [ "$(CreoleGet activer_one_ha)" = "oui" ]; then if [ "$(CreoleGet one_ha_server_index)" != "0" ]; then - follower=0 + exit 0 else master=0 fi @@ -154,8 +159,8 @@ for host in ${HAPY_SLV}; do EchoVert " * Gestion des clés SSH" echo copy_ssh_id ${host} - if [ $follower = 0 ]; then - continue + if [ $master = 0 ]; then + copy_files ${host} fi EchoVert " * Enregistrement du noeud"