aboutsummaryrefslogtreecommitdiffstats
path: root/boot
diff options
context:
space:
mode:
Diffstat (limited to 'boot')
-rw-r--r--boot/asdc_vm_init.sh8
-rw-r--r--boot/mso_vm_init.sh9
-rw-r--r--boot/policy_vm_init.sh9
-rw-r--r--boot/portal_vm_init.sh7
4 files changed, 29 insertions, 4 deletions
diff --git a/boot/asdc_vm_init.sh b/boot/asdc_vm_init.sh
index 48f12905..e6a302c4 100644
--- a/boot/asdc_vm_init.sh
+++ b/boot/asdc_vm_init.sh
@@ -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
diff --git a/boot/mso_vm_init.sh b/boot/mso_vm_init.sh
index 1f89a4ef..8a8b8ed4 100644
--- a/boot/mso_vm_init.sh
+++ b/boot/mso_vm_init.sh
@@ -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",
diff --git a/boot/policy_vm_init.sh b/boot/policy_vm_init.sh
index 7febca20..bdb89be8 100644
--- a/boot/policy_vm_init.sh
+++ b/boot/policy_vm_init.sh
@@ -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
diff --git a/boot/portal_vm_init.sh b/boot/portal_vm_init.sh
index 05e969fc..0a2e51e9 100644
--- a/boot/portal_vm_init.sh
+++ b/boot/portal_vm_init.sh
@@ -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