From b24e35fa51bc188ca691cb78dc64ab019c700e44 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Thu, 8 Dec 2016 22:52:12 -0500 Subject: [PATCH] Seperate the case of using agent with local server from with c.stack360.io Change-Id: I648fcb19415494fff5564b9269b05e8cd2ff08e6 --- install/compass.sh | 5 +++++ install/install.conf | 2 ++ install/register.sh | 1 - 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/install/compass.sh b/install/compass.sh index 65373dbd..9fc0dd62 100755 --- a/install/compass.sh +++ b/install/compass.sh @@ -95,6 +95,8 @@ domains=$(echo $NAMESERVER_DOMAINS | sed "s/,/','/g") sudo sed -i "s/\$domains/$domains/g" /etc/compass/setting if [ "$FULL_COMPASS_SERVER" == "true" ]; then sudo sed -i "/DATABASE_SERVER =/c\DATABASE_SERVER = '127.0.0.1:3306'" /etc/compass/setting +else + sudo sed -i "/DATABASE_SERVER =/c\DATABASE_SERVER = '\$COMPASS_API_SERVER:3306'" /etc/compass/setting fi sudo sed -i "s/\$cobbler_ip/$IPADDR/g" /etc/compass/os_installer/cobbler.conf @@ -130,6 +132,9 @@ else fi if [ "$FULL_COMPASS_SERVER" == "true" ]; then sudo mv /etc/compass/celeryconfig_local /etc/compass/celeryconfig +elif [ "$COMPASS_API_SERVER" != "c.stack360.io" ];then + sudo mv /etc/compass/celeryconfig_local /etc/compass/celeryconfig + sudo sed -i "s/localhost/\$COMPASS_API_SERVER/g" /etc/compass/celeryconfig else sudo mv /etc/compass/celeryconfig_remote /etc/compass/celeryconfig wget -O /tmp/aws_credentials "http://www.stack360.io/aws_credentials" diff --git a/install/install.conf b/install/install.conf index 41e672c3..c8f34c65 100755 --- a/install/install.conf +++ b/install/install.conf @@ -7,6 +7,8 @@ export FULL_COMPASS_SERVER="true" export USER_EMAIL="test@huawei.com" # User Password export USER_PASSWORD= +# Compass Server Address, required if installing agent +export COMPASS_API_SERVER="c.stack360.io" # OS_INSTALLER indicates the tool for OS provisioning, default is 'cobbler'. export OS_INSTALLER="cobbler" diff --git a/install/register.sh b/install/register.sh index 0846597b..5d4f12e8 100755 --- a/install/register.sh +++ b/install/register.sh @@ -8,7 +8,6 @@ echo "The email address you use to register is ${USER_EMAIL}" password=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c6` USER_PASSWORD="${USER_PASSWORD:-$password}" data=`echo "{\"email\":\"${USER_EMAIL}\",\"password\":\"${USER_PASSWORD}\"}"` -COMPASS_API_SERVER="c.stack360.io" if [ "$FULL_COMPASS_SERVER" == "true" ]; then COMPASS_API_SERVER="127.0.0.1" fi