From 40d512e263030b4d82c0974d96ec0316d39222e3 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 25 Mar 2019 12:09:29 -0500 Subject: [PATCH] update --- defaults.inc | 1 + nodemgmt-scripts.sh | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/defaults.inc b/defaults.inc index dc1c6e99..098b3a3a 100755 --- a/defaults.inc +++ b/defaults.inc @@ -5,6 +5,7 @@ NODEHOSTS=10.5.10.51,10.5.10.52,10.5.10.53 WEBHOSTS=10.5.10.121,10.5.10.122,10.5.10.123 LBHOSTS=10.10.10.81,10.10.10.82,10.10.10.83 PRIMARYHOST=10.5.10.51 +MYSQLMANAGER=10.5.10.50 NODESERVICES=mysql,nginx,gitea,powerdns-admin,haproxy,keepalived,maxscale,postgresql NODESERVICES_CHECK=mysql WEBSERVICES_CHECK=nginx,gitea diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 01f5be68..2599288a 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -1641,6 +1641,16 @@ KEEPALIVE-CONFIG() { NODEUPDATE() { echo -e "${idsCL[LightGreen]}Updating All Nodes and Webservers${idsCL[Default]}" echo -e "${idsCL[LightGreen]}-------------------------------------------${idsCL[Default]}" + if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${MYSQLMANAGER}"* ]]; then + nip='localhost ' + NCMD='' + else + nip=${MYSQLMANAGER} + NCMD="ssh root@${MYSQLMANAGER}" + fi + echo -en "Updating MySQL-Manager ($nip)... ${idsCL[Default]}" + ${NCMD} "nodemgmt update q" + echo -e "${idsCL[Green]}COMPLETE${idsCL[Default]}" nid=1 for nip in "${NODE_HOSTS[@]}"; do if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then @@ -1656,6 +1666,20 @@ NODEUPDATE() { done echo nid=1 + for nip in "${LB_HOSTS[@]}"; do + if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then + nip='localhost ' + NCMD='' + else + NCMD="ssh root@${nip}" + fi + echo -en "Updating LB-Node${nid} ($nip)... ${idsCL[Default]}" + ${NCMD} "nodemgmt update q" + echo -e "${idsCL[Green]}COMPLETE${idsCL[Default]}" + nid=`expr $nid + 1` + done + echo + nid=1 for nip in "${WEB_HOSTS[@]}"; do if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then nip='localhost '