Fixes horizon IP URL for non-HA deployments 37/1437/1
authorTim Rozet <trozet@redhat.com>
Tue, 8 Sep 2015 18:17:28 +0000 (14:17 -0400)
committerTim Rozet <trozet@redhat.com>
Wed, 9 Sep 2015 13:59:42 +0000 (13:59 +0000)
The printed horizon URL at the end of a successful deployment was
incorrect for non-HA deployments.  The private IP was being printed
which is not publicly accessible.  This patch fixes the URL printed to
be the public IP of the control node - the correct URL.

JIRA: APEX-12

Change-Id: Ia2f594e0cf839a9100c3bf5715a38fe4fd243bfe
Signed-off-by: Tim Rozet <trozet@redhat.com>
(cherry picked from commit db4a9ac5492659cd435b4e4e84868510259c6b29)

foreman/ci/deploy.sh

index 0803993..29ad83c 100755 (executable)
@@ -1140,7 +1140,21 @@ start_virtual_nodes() {
     if [ ! -z "$horizon_public_vip" ]; then
       echo "${blue} Virtual deployment SUCCESS!! Foreman URL:  http://${foreman_ip}, Horizon URL: http://${horizon_public_vip} ${reset}"
     else
-      echo "${blue} Virtual deployment SUCCESS!! Foreman URL:  http://${foreman_ip}, Horizon URL: http://${odl_control_ip} ${reset}"
+      ##Find public IP of controller
+      for node in ${nodes}; do
+        node_type=config_nodes_${node}_type
+        node_type=$(eval echo \$$node_type)
+        if [ "$node_type" == "controller" ]; then
+          pushd $vm_dir/$node
+          horizon_ip=`vagrant ssh -c "ifconfig enp0s10" | grep -Eo "inet [0-9\.]+" | awk {'print $2'}`
+          popd
+          break
+        fi
+      done
+      if [ -z "$horizon_ip" ]; then
+        echo "${red}Warn: Unable to determine horizon IP, please login to your controller node to find it${reset}"
+      fi
+      echo "${blue} Virtual deployment SUCCESS!! Foreman URL:  http://${foreman_ip}, Horizon URL: http://${horizon_ip} ${reset}"
     fi
   fi
 }