Externalize IP_ADDRESS variable 19/7219/1
authorVictor Morales <victor.morales@intel.com>
Thu, 10 Aug 2017 15:27:38 +0000 (10:27 -0500)
committerVictor Morales <victor.morales@intel.com>
Thu, 10 Aug 2017 15:27:38 +0000 (10:27 -0500)
Several places were using this variable, therefore it was placed
in a common place.

Change-Id: I481a62482cd2bb55b4a76623309d0977ddb67fe7
Signed-off-by: Victor Morales <victor.morales@intel.com>
bootstrap/vagrant-onap/lib/functions
bootstrap/vagrant-onap/lib/policy
bootstrap/vagrant-onap/lib/portal
bootstrap/vagrant-onap/lib/sdc

index d0a7d97..9b903d9 100755 (executable)
@@ -12,6 +12,7 @@ git_src_folder=/opt
 # export_env_vars() - Export environment variables
 function export_env_vars {
     export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' |sort -n | head -1)
+    export IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
 }
 
 # configure_dns() - DNS/GW IP address configuration
index b987c4c..f4dc5fb 100755 (executable)
@@ -44,7 +44,6 @@ function install_policy {
     fi
     pushd $src_folder/docker
     chmod +x config/drools/drools-tweaks.sh
-    IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
     echo $IP_ADDRESS > config/pe/ip_addr.txt
     install_docker_compose
     /opt/docker/docker-compose up -d
index 6c8e7d0..8bd39b7 100755 (executable)
@@ -55,7 +55,6 @@ function install_portal {
     sleep 180
 
     if [ ! -e /opt/config/boot.txt ]; then
-        IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
         install_package mysql-client
         mysql -u root -p'Aa123456' -h $IP_ADDRESS < Apps_Users_OnBoarding_Script.sql
         echo "yes" > /opt/config/boot.txt
index 626d9d7..d3619f5 100755 (executable)
@@ -67,7 +67,6 @@ function compile_all_sdc_repos {
 
 # install_sdc() - Function that pull templates and executes
 function install_sdc {
-    IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
     local ENV_NAME=$dmaap_topic
     local MR_IP_ADDR='10.0.11.1'
     local RELEASE=$docker_version