Merge "Fixes horizon IP URL for non-HA deployments"
authorTim Rozet <trozet@redhat.com>
Wed, 9 Sep 2015 13:45:16 +0000 (13:45 +0000)
committerGerrit Code Review <gerrit@172.30.200.206>
Wed, 9 Sep 2015 13:45:17 +0000 (13:45 +0000)
1  2 
foreman/ci/deploy.sh

diff --combined foreman/ci/deploy.sh
@@@ -539,13 -539,6 +539,13 @@@ configure_network() 
      ##set variable info
      if [ ! -z "$static_ip_range" ]; then
        new_ip=$(echo $static_ip_range | cut -d , -f1)
 +      subnet_mask=$(find_netmask $this_default_gw_interface)
 +      host_subnet=$(find_subnet $interface_ip $subnet_mask)
 +      ip_range_subnet=$(find_subnet $new_ip $subnet_mask)
 +      if [ "$ip_range_subnet" != "$host_subnet" ]; then
 +        echo "${red}static_ip_range: ${static_ip_range} is not in the same subnet as your default gateway interface: ${host_subnet}.  Please use a correct range!${reset}"
 +        exit 1
 +      fi
      else
        new_ip=$(next_usable_ip $interface_ip)
        if [ ! "$new_ip" ]; then
@@@ -1140,7 -1133,21 +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
  }