Merge branch 'develop' into dist/eole/2.7.0/develop

This commit is contained in:
vincent 2019-03-01 09:19:03 +01:00
commit 458e5b4ca2
2 changed files with 52 additions and 36 deletions

View File

@ -1,5 +1,15 @@
#!/bin/bash #!/bin/bash
/usr/share/eole/sbin/onehost_create_all ha=$(CreoleGet activer_one_ha non)
if [[ ${ha} == "oui" ]]
then
indx=$(CreoleGet one_ha_server_index)
else
indx="0"
fi
if [[ ${1} == "instance" ]] && [[ ${indx} == "0" ]]
then
/usr/share/eole/sbin/onehost_create_all
fi
exit 0 exit 0

View File

@ -28,6 +28,7 @@ EOF
REMOTEKEY=$(su - oneadmin -c "ssh ${host} 'cat ~oneadmin/.ssh/id_rsa.pub'") REMOTEKEY=$(su - oneadmin -c "ssh ${host} 'cat ~oneadmin/.ssh/id_rsa.pub'")
if ! grep -qs "$REMOTEKEY" ~oneadmin/.ssh/authorized_keys; then if ! grep -qs "$REMOTEKEY" ~oneadmin/.ssh/authorized_keys; then
su - oneadmin -c "echo ${REMOTEKEY} >> ~oneadmin/.ssh/authorized_keys" su - oneadmin -c "echo ${REMOTEKEY} >> ~oneadmin/.ssh/authorized_keys"
su - oneadmin -c "ssh-keyscan $host"
fi fi
} }
@ -159,6 +160,18 @@ fi
HAPY_HA=$(CreoleGet activer_one_ha "non") HAPY_HA=$(CreoleGet activer_one_ha "non")
master=1
if [[ ${HAPY_HA} == "oui" ]]; then
idx=$(CreoleGet one_ha_server_index)
if [[ ${idx} != "0" ]]; then
EchoBleu "Mode HA: (on) Index : [${idx}]"
echo -e "\t$(basename ${0}) doit être lancé uniquement sur le leader (index 0)"
exit 0
else
master=0
fi
fi
declare -a HAPY_SLV=('') declare -a HAPY_SLV=('')
ONEUSER=$(CreoleGet virt_user) ONEUSER=$(CreoleGet virt_user)
HAPY_SLV=$(echo $(CreoleGet one_nodes) | sed -e "s/\n/ /g") HAPY_SLV=$(echo $(CreoleGet one_nodes) | sed -e "s/\n/ /g")
@ -174,14 +187,7 @@ then
exit 1 exit 1
fi fi
master=1
if [ "$(CreoleGet activer_one_ha)" = "oui" ]; then
if [ "$(CreoleGet one_ha_server_index)" != "0" ]; then
exit 0
else
master=0
fi
fi
for host in ${HAPY_SLV}; do for host in ${HAPY_SLV}; do
echo -e "\n" echo -e "\n"
EchoOrange "Traitement du noeud ${host}" EchoOrange "Traitement du noeud ${host}"