update init scripts 47/2147/1
authorplatania <platania@research.att.com>
Tue, 14 Mar 2017 22:24:59 +0000 (18:24 -0400)
committerplatania <platania@research.att.com>
Tue, 14 Mar 2017 22:24:59 +0000 (18:24 -0400)
Change-Id: If1b4a67fb5fda5125dc65b801974d1d1badc1364
Signed-off-by: platania <platania@research.att.com>
boot/asdc_vm_init.sh
boot/mso_vm_init.sh
boot/policy_vm_init.sh
boot/portal_vm_init.sh

index 48f1290..e6a302c 100644 (file)
@@ -18,7 +18,13 @@ cp sdc/sdc-os-chef/scripts/docker_health.sh /data/scripts
 chmod +x /data/scripts/docker_run.sh
 chmod +x /data/scripts/docker_health.sh
 
-IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
+if [ -e /opt/config/public_ip.txt ]
+then
+  IP_ADDRESS=$(cat /opt/config/public_ip.txt)
+else
+  IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
+fi
+
 cat /data/environments/Template.json | sed "s/yyy/"$IP_ADDRESS"/g" > /data/environments/$ENV_NAME.json
 sed -i "s/xxx/"$ENV_NAME"/g" /data/environments/$ENV_NAME.json
 sed -i "s/\"ueb_url_list\":.*/\"ueb_url_list\": \""$MR_IP_ADDR","$MR_IP_ADDR"\",/g" /data/environments/$ENV_NAME.json
index 1f89a4e..8a8b8ed 100644 (file)
@@ -8,6 +8,13 @@ OPENSTACK_APIKEY=$(cat /opt/config/api_key.txt)
 DMAAP_TOPIC=$(cat /opt/config/dmaap_topic.txt)
 export MSO_DOCKER_IMAGE_VERSION=latest
 
+if [ -e /opt/config/keystone.txt ]
+then
+  KEYSTONE_URL=$(cat /opt/config/keystone.txt)
+else
+  KEYSTONE_URL="https://identity.api.rackspacecloud.com/v2.0"
+fi
+
 # Update the MSO configuration file.
 read -d '' MSO_CONFIG_UPDATES <<-EOF
 {
@@ -25,7 +32,7 @@ read -d '' MSO_CONFIG_UPDATES <<-EOF
            "identity_services": 
                [
                    {"dcp_clli": "RAX_KEYSTONE", 
-                    "identity_url": "https://identity.api.rackspacecloud.com/v2.0", 
+                    "identity_url": "$KEYSTONE_URL",
                     "mso_id": "$OPENSTACK_USERNAME", 
                     "mso_pass": "$OPENSTACK_APIKEY", 
                     "admin_tenant": "service", 
index 7febca2..bdb89be 100644 (file)
@@ -10,7 +10,14 @@ cd /opt/policy
 git pull
 
 chmod +x config/drools/drools-tweaks.sh
-IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
+
+if [ -e /opt/config/public_ip.txt ]
+then
+  IP_ADDRESS=$(cat /opt/config/public_ip.txt)
+else
+  IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
+fi
+
 echo $IP_ADDRESS > config/pe/ip_addr.txt
 
 docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO
index 05e969f..0a2e51e 100644 (file)
@@ -33,7 +33,12 @@ sleep 180
 
 if [ ! -e /opt/config/boot.txt ]
 then
-  IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
+  if [ -e /opt/config/public_ip.txt ]
+  then
+    IP_ADDRESS=$(cat /opt/config/public_ip.txt)
+  else
+    IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
+  fi
   mysql -u root -p'Aa123456' -h $IP_ADDRESS < /opt/portal/deliveries/Apps_Users_OnBoarding_Script.sql
   echo "yes" > /opt/config/boot.txt
 fi