Fix hard-coded etherenet interfaces on LVS servers.
authorAndy Witter <awitter@georgialibraries.org>
Thu, 4 Apr 2019 19:45:16 +0000 (15:45 -0400)
committerAndy Witter <awitter@georgialibraries.org>
Thu, 4 Apr 2019 19:45:16 +0000 (15:45 -0400)
templates/lvs/haresources
templates/lvs/interfaces
templates/setup-drone.sh
templates/setup-functions
templates/setup-head.sh
templates/setup.sh

index 20ee583..b3b8154 100755 (executable)
@@ -1 +1 @@
-FIRST_LVS      IPaddr::ClusterPublic_IP/ClusterPublic_CIDR/eth1/ClusterPublic_Bcast IPaddr::Lvs01Private_Shared_IP/24/eth0/lvs01Private_Net.255
+FIRST_LVS      IPaddr::ClusterPublic_IP/ClusterPublic_CIDR/Primary_Interface/ClusterPublic_Bcast IPaddr::Lvs01Private_Shared_IP/24/Private_Interface/lvs01Private_Net.255
index 07a721e..ab95555 100755 (executable)
@@ -6,8 +6,8 @@ auto lo
 iface lo inet loopback
 
 # The primary network interface
-auto eth1
-iface eth1 inet static
+auto Primary_Interface
+iface Primary_Interface inet static
        name Public Address
        address Pub_IP
        netmask Pub_NETMASK
@@ -16,22 +16,22 @@ iface eth1 inet static
        dns-nameservers 127.0.0.1 LVS01_Private_IP LVS02_Private_IP
        dns-search CLUSTER_DOMAINNAME
        
-auto eth1:0
-iface eth1:0 inet static
+auto Primary_Interface:0
+iface Primary_Interface:0 inet static
        name LVS Public Shared Address
        address Cluster_Public_IP
        netmask Pub_NETMASK
 
 
 
-auto eth0
-iface eth0 inet static
+auto Private_Interface
+iface Private_Interface inet static
        name Private Address
        address Priv_Physical_Address
        netmask 255.255.255.0
 
-auto eth0:0
-iface eth0:0 inet static
+auto Private_Interface:0
+iface Private_Interface:0 inet static
         name LVS Private Shared Address
         address Priv_NET.1
         netmask 255.255.255.0
index 26e0c53..86708dd 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+exec > >(tee -i genasys_install.log)
+
 #TODO: export GenaSYS version to install logs.
 
 export WD=$(dirname $(readlink -f $0))
index 0b5d060..ff66067 100755 (executable)
@@ -11,7 +11,7 @@ GetNics () { ### get the primary and secondary interface of this host.
 INTERFACES="$(networkctl | grep -wv 'links' | grep -wv IDX | awk '{ print $2 }')"
 PRIMARY_INTERFACE="$(ip route | grep default | awk '{ print $5 }')"
 FIRST_PHYSICAL_INTERFACE="$(networkctl | grep -wv 'links' | grep -w '2' | awk '{ print $2 }')"
-SECOND_PHYSICAL_INTERFACE="$(networkctl | grep -wv 'links' | grep -w '3' | awk '{ print $3 }')"
+SECOND_PHYSICAL_INTERFACE="$(networkctl | grep -wv 'links' | grep -w '3' | awk '{ print $2 }')"
 echo;echo
 echo "Interfaces found: "${INTERFACES}
 echo "Primary interface is: ${PRIMARY_INTERFACE}"
@@ -159,6 +159,7 @@ if [ ! -z "$PRIMARY_INTERFACE" ]; then #TODO update variable - done
 else
    echo "ERROR: Unable to set primary interface. You must edit /etc/network/interfaces manually."
 fi
+#TODO expand this function to handle all interfaces anywhere. aw-4/4/2019
 }
 
 ### Setup monitoring.
index e1b8683..98ef157 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+exec > >(tee -i genasys_install.log)
+
 export WD=$(dirname $(readlink -f $0))
 TARCHIVE="head_file.tar.gz"
 . "$WD/setup-vars"
index efcd7e1..26d9ba6 100755 (executable)
@@ -2,6 +2,8 @@
 
 ###TODO: export GenaSYS version to install logs.
 
+exec > >(tee -i genasys_install.log)
+
 export WD=$(dirname $(readlink -f $0))
 TARCHIVE="tar_file.tar.gz"
 . "$WD/setup-vars"
@@ -699,6 +701,10 @@ then
                 a2ensite default-ssl.conf
         fi
        GetNics
+       sed -i "s/Primary_Interface/${PRIMARY_INTERFACE}/g" /etc/network/interfaces
+       sed -i "s/Private_Interface/${SECOND_PHYSICAL_INTERFACE}/g" /etc/network/interfaces
+       sed -i "s/Primary_Interface/${PRIMARY_INTERFACE}/g" /etc/ha.d/haresources
+        sed -i "s/Private_Interface/${SECOND_PHYSICAL_INTERFACE}/g" /etc/ha.d/haresources
        # configure firewall for lvs servers
        sed -i "s/XTRNL_IF/$PRIMARY_INTERFACE/g" "/etc/network/iptables-rules.fw" #TODO update variable and switch from hard coded interface name - done
        # find secondary interface