summaryrefslogtreecommitdiffstats
path: root/components/congress/test-webapp
diff options
context:
space:
mode:
authorblsaws <bryan.sullivan@att.com>2016-05-17 06:56:15 -0700
committerblsaws <bryan.sullivan@att.com>2016-05-17 06:56:15 -0700
commit4c972868690788e9a186bfffd84ff19188ec4dff (patch)
treea91f26b6bdc6de3dcfe7948c450a0e7f70a1ab96 /components/congress/test-webapp
parent8dcfe1a692815ee3a34dca32fd427471dfd0046a (diff)
Initial Centos scripts (incomplete)
JIRA: COPPER-2 Change-Id: I28c513995fba02b025ed3e23f58b957ab88ea801 Signed-off-by: blsaws <bryan.sullivan@att.com>
Diffstat (limited to 'components/congress/test-webapp')
-rw-r--r--components/congress/test-webapp/setup/install_congress_testserver_1.sh75
-rw-r--r--components/congress/test-webapp/setup/install_congress_testserver_2.sh8
2 files changed, 49 insertions, 34 deletions
diff --git a/components/congress/test-webapp/setup/install_congress_testserver_1.sh b/components/congress/test-webapp/setup/install_congress_testserver_1.sh
index b69cf3f..400d27e 100644
--- a/components/congress/test-webapp/setup/install_congress_testserver_1.sh
+++ b/components/congress/test-webapp/setup/install_congress_testserver_1.sh
@@ -16,51 +16,64 @@
# What this is: script 1 of 2 for installation of a test server for Congress.
# Status: this is a work in progress, under test.
#
-# Prequisite: OPFNV install per https://wiki.opnfv.org/copper/academy/joid
+# Prequisite: OPFNV installed per JOID or Apex installer
# On jumphost:
# - Congress installed through install_congress_1.sh
# - ~/env.sh created as part of Congress install (install_congress_1.sh)
# How to use:
-# $ source install_congress_testserver_1.sh <controller_hostname>
-# <controller_hostname> is the name of the controller node in MAAS
+# $ source install_congress_testserver_1.sh [<controller_hostname>]
+# If provided, <controller_hostname> is the name of the controller node in MAAS
+# (the parameter is not used for Apex-based installs)
-# Create and Activate the Container
-# Earlier versions of the JOID installer installed lxc and created local templates
-# but now we have to get the ubuntu template from the controller
+set -x
-if [ $# -lt 1 ]; then
- echo 1>&2 "$0: arguments required <controller_hostname>"
- return 2
-fi
+echo "Install prerequisites"
+dist=`grep DISTRIB_ID /etc/*-release | awk -F '=' '{print $2}'`
+
+if [ "$dist" == "Ubuntu" ]; then
+ # Create and Activate the Container
+ # Earlier versions of the JOID installer installed lxc and created local templates
+ # but now we have to get the ubuntu template from the controller
-if [ $# -eq 2 ]; then
- if [ $2 == "debug" ]; then set -x #echo on
+ if [ $# -lt 1 ]; then
+ echo 1>&2 "$0: arguments required <controller_hostname>"
+ set +x
+ return 2
fi
+
+ sudo apt-get install -y lxc
+ echo "Copy lxc-ubuntu container from the controller"
+ juju scp ubuntu@$1:/usr/share/lxc/templates/lxc-ubuntu ~/lxc-ubuntu
+ sudo cp ~/lxc-ubuntu /usr/share/lxc/templates/lxc-ubuntu
+ echo "Create the copper container"
+ sudo lxc-create -n copper -t /usr/share/lxc/templates/lxc-ubuntu -l DEBUG -- -b $USER ~/$USER
+else
+ sudo yum install -y epel-release
+ sudo yum install -y debootstrap perl
+ sudo yum install -y lxc lxc-templates
+ sudo systemctl start lxc.service
+ echo "Create the copper container"
+ brctl addbr virbr0
+ # TODO: this is not yet working - need additional config
+ sudo lxc-create -t download -n copper -- -d ubuntu -r trusty -a amd64 -- -b $USER ~/$USER
fi
-echo "Install prerequisites"
-sudo apt-get install -y lxc
-echo "Copy lxc-ubuntu container from the controller"
-juju scp ubuntu@$1:/usr/share/lxc/templates/lxc-ubuntu ~/lxc-ubuntu
-sudo cp ~/lxc-ubuntu /usr/share/lxc/templates/lxc-ubuntu
-echo "Create the trusty-copper container"
-sudo lxc-create -n trusty-copper -t /usr/share/lxc/templates/lxc-ubuntu -l DEBUG -- -b $USER ~/$USER
-echo "Start trusty-copper"
-sudo lxc-start -n trusty-copper -d
+echo "Start copper"
+sudo lxc-start -n copper -d
if (($? > 0)); then
- echo Error starting trusty-copper lxc container
+ echo Error starting copper lxc container
return
fi
echo "Get the CONGRESS_HOST value from env.sh"
source ~/env.sh
-echo "Get trusty-copper address"
+echo "Get copper address"
sleep 5
export COPPER_HOST=""
while [ "$COPPER_HOST" == "" ]; do
sleep 5
- export COPPER_HOST=$(sudo lxc-info --name trusty-copper | grep IP | awk "/ / { print \$2 }")
+ export COPPER_HOST=$(sudo lxc-info --name copper | grep IP | awk "/ / { print \$2 }")
done
echo COPPER_HOST = $COPPER_HOST
@@ -68,15 +81,15 @@ echo "Create the environment file"
cat <<EOF >~/env.sh
export COPPER_HOST=$COPPER_HOST
export CONGRESS_HOST=$CONGRESS_HOST
-export KEYSTONE_HOST=$(juju status --format=short | awk "/keystone\/0/ { print \$3 }")
-export CEILOMETER_HOST=$(juju status --format=short | awk "/ceilometer\/0/ { print \$3 }")
-export CINDER_HOST=$(juju status --format=short | awk "/cinder\/0/ { print \$3 }")
-export GLANCE_HOST=$(juju status --format=short | awk "/glance\/0/ { print \$3 }")
-export NEUTRON_HOST=$(juju status --format=short | awk "/neutron-api\/0/ { print \$3 }")
-export NOVA_HOST=$(juju status --format=short | awk "/nova-cloud-controller\/0/ { print \$3 }")
+export KEYSTONE_HOST=$KEYSTONE_HOST
+export CEILOMETER_HOST=$CEILOMETER_HOST
+export CINDER_HOST=$CINDER_HOST
+export GLANCE_HOST=$GLANCE_HOST
+export NEUTRON_HOST=$NEUTRON_HOST
+export NOVA_HOST=$NOVA_HOST
EOF
-echo "Invoke install_congress_testserver_2.sh on trusty-copper"
+echo "Invoke install_congress_testserver_2.sh on copper"
ssh -t -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $USER@$COPPER_HOST "source ~/git/copper/components/congress/test-webapp/setup/install_congress_testserver_2.sh; exit"
set +x
diff --git a/components/congress/test-webapp/setup/install_congress_testserver_2.sh b/components/congress/test-webapp/setup/install_congress_testserver_2.sh
index 93d58d8..0f9ee57 100644
--- a/components/congress/test-webapp/setup/install_congress_testserver_2.sh
+++ b/components/congress/test-webapp/setup/install_congress_testserver_2.sh
@@ -16,12 +16,14 @@
# What this is: script 2 of 2 for installation of a test server for Congress.
# Status: this is a work in progress, under test.
#
-# Prequisite: OPFNV install per https://wiki.opnfv.org/copper/academy/joid
+# Prequisite: OPFNV installed per JOID or Apex installer
# On jumphost:
# - Congress installed through install_congress_1.sh
+# - ~/env.sh created as part of Congress install (install_congress_1.sh)
# How to use:
-# $ source install_congress_testserver_1.sh <controller_hostname>
-# <controller_hostname> is the name of the controller node in MAAS
+# $ source install_congress_testserver_1.sh [<controller_hostname>]
+# If provided, <controller_hostname> is the name of the controller node in MAAS
+# (the parameter is not used for Apex-based installs)
echo "Setup OpenStack environment variables per your OPNFV install"
source ~/env.sh