diff options
author | blsaws <bs3131@att.com> | 2016-02-19 16:55:38 -0800 |
---|---|---|
committer | blsaws <bs3131@att.com> | 2016-02-19 16:55:38 -0800 |
commit | 25e123906677f766828c823e3594648b821f3120 (patch) | |
tree | 4b1d8019f03fbfe58cff13cba33627f78a4f10bb /components/congress/joid/install_congress_1.sh | |
parent | 95c6b9fa252d104097d540cc9d33b9b391888cd0 (diff) |
Complete congress bash script install automation.
JIRA: COPPER-2
Change-Id: I64746cf76750516812a094778c92967c9515f979
Signed-off-by: blsaws <bs3131@att.com>
Diffstat (limited to 'components/congress/joid/install_congress_1.sh')
-rw-r--r-- | components/congress/joid/install_congress_1.sh | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/components/congress/joid/install_congress_1.sh b/components/congress/joid/install_congress_1.sh index f2fc4da..251eb67 100644 --- a/components/congress/joid/install_congress_1.sh +++ b/components/congress/joid/install_congress_1.sh @@ -13,16 +13,42 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This is script 1 of 5 for installation of Congress on an Ubuntu 14.04 +# This is script 1 of 2 for installation of Congress on an Ubuntu 14.04 # LXC container in the OPNFV Controller node. # Prequisite: OPFNV install per https://wiki.opnfv.org/copper/academy/joid # # On jumphost: # Download admin-openrc.sh from Horizon and save in ~ # source ~/git/copper/components/congress/joid/install_congress_1.sh -# (copies install_congress_2.sh to node1-control and executes it) -# next: see install_congress_3.sh -juju scp ~/git/copper/components/congress/joid/install_congress_2.sh ubuntu@node1-control:/home/ubuntu -juju ssh ubuntu@node1-control "source ~/install_congress_2.sh; exit" -return +set -x + +# Create the congress container +juju ssh ubuntu@node1-control "sudo lxc-clone -o juju-trusty-lxc-template -n juju-trusty-congress; sudo lxc-start -n juju-trusty-congress -d; exit" + +# Get the congress server address +CONGRESS_HOST="" +while [ "$CONGRESS_HOST" == "" ]; do + sleep 5 + CONGRESS_HOST=$(juju ssh ubuntu@node1-control "sudo lxc-info --name juju-trusty-congress | grep IP" | awk "/ / { print \$2 }" | tr -d '\r') +done + +# Create the environment file and copy to the congress server +cat <<EOF >~/env.sh +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 }") +EOF +source ~/env.sh +juju scp ~/admin-openrc.sh ubuntu@$CONGRESS_HOST:/home/ubuntu +juju scp ~/env.sh ubuntu@$CONGRESS_HOST:/home/ubuntu + +# Copy the install script to the congress server and execute +juju scp ~/git/copper/components/congress/joid/install_congress_2.sh ubuntu@$CONGRESS_HOST:/home/ubuntu +ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ubuntu@$CONGRESS_HOST "source ~/install_congress_2.sh; exit" + +set +x |