diff options
author | bryan <bryan@localhost.localdomain> | 2017-02-06 21:47:16 -0800 |
---|---|---|
committer | bryan <bryan.sullivan@att.com> | 2017-02-07 06:31:02 -0800 |
commit | f5e6ad1a1bd58a8d383ccf4b2e35b89702e01e7a (patch) | |
tree | eaf02b4554e2888d38eb67b93c7b2b2a243c6c37 /components/congress/install/bash/clean_congress.sh | |
parent | c1d2d78f1d0b528b2529f614342ead89b4b69b49 (diff) |
Update Congress bash installer for Danube / Newton
JIRA: COPPER-2
Update description and usage.
Add docker container deployment option, with /opt/congress
as shared folder. Update OSC commands.
Include congress.conf.sample due to issues with tox.
Run tox as sudo.
Disable tox for now due to to hangs.
Change-Id: I425a75c967a6a0608e8b836f5140973b80c1657e
Signed-off-by: blsaws <bryan.sullivan@att.com>
Signed-off-by: bryan <bryan.sullivan@att.com>
Diffstat (limited to 'components/congress/install/bash/clean_congress.sh')
-rw-r--r-- | components/congress/install/bash/clean_congress.sh | 77 |
1 files changed, 30 insertions, 47 deletions
diff --git a/components/congress/install/bash/clean_congress.sh b/components/congress/install/bash/clean_congress.sh index b00a050..9180f38 100644 --- a/components/congress/install/bash/clean_congress.sh +++ b/components/congress/install/bash/clean_congress.sh @@ -17,59 +17,42 @@ # node as installed via JOID or Apex (Fuel and Compass not yet verified). # Presumably something has failed, and any record of the Congress feature # in OpenStack needs to be removed, so you can try the install again. +# This is script 2 of 2 for installation of OpenStack Congress. # Prerequisites: -# - OPFNV installed via JOID or Apex -# - For Apex installs, on the jumphost, ssh to the undercloud VM and -# $ su stack -# - For JOID installs, admin-openrc.sh saved from Horizon to ~/admin-openrc.sh -# - Retrieve the copper removal script as below -# $ cd ~ -# $ wget https://git.opnfv.org/cgit/copper/plain/components/congress/install/bash/clean_congress.sh -# $ bash clean_congress.sh - -sudo -i - -echo "OS-specific prerequisite steps" -dist=`grep DISTRIB_ID /etc/*-release | awk -F '=' '{print $2}'` - -source ~/congress/env.sh - -if [ "$dist" == "Ubuntu" ]; then - # Ubuntu - echo "Ubuntu-based install" - export CTLUSER="ubuntu" - echo "Stop the Congress service" - # Have to use "python" here as congress-server does not show up in the process list (?) - ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $CTLUSER@$CONGRESS_HOST "pkill python; exit" -else - export CTLUSER="heat-admin" - echo "Stop the Congress service" - ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $CTLUSER@$CONGRESS_HOST "pkill congress-server; exit" +# - OpenStack base deployment. +# Usage: +# $ bash clean_congress.sh <target> <user> +# <target>: IP/hostname where Congress is being installed +# localhost: install in a docker container on the current host +# IP address: install in a virtualenv +# <user>: IP/hostname where Congress is being installed +# +target=$1 +user=$2 + +source /opt/congress/admin-openrc.sh +source /opt/congress/venv/bin/activate + +if [[ "$target" == "localhost" ]]; then + sudo docker stop congress + sudo docker rm -v congress +else + echo "Remove systemd integration" + ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$target "sudo rm -f /usr/lib/systemd/system/openstack-congress.service; sudo rm -f /etc/init.d/congress-server; exit" + + echo "Remove the Congress virtualenv and code" + ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$target "rm -rf /opt/congress; exit" + + echo "Delete Congress database" + ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$target "sudo mysql -e \"DROP DATABASE congress\"; exit" fi -source ~/admin-openrc.sh - -echo "Remove systemd integration" -ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $CTLUSER@$CONGRESS_HOST "sudo rm -f /usr/lib/systemd/system/openstack-congress.service; sudo rm -f /etc/init.d/congress-server; exit" - -echo "Remove the Congress virtualenv and code" -ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $CTLUSER@$CONGRESS_HOST "rm -rf ~/congress; exit" - echo "Delete Congress user" -export CONGRESS_USER=$(openstack user list | awk "/ congress / { print \$2 }") -if [ "$CONGRESS_USER" != "" ]; then - openstack user delete $CONGRESS_USER -fi +openstack user delete congress echo "Delete Congress service" -export CONGRESS_SERVICE=$(openstack service list | awk "/ congress / { print \$2 }") -if [ "$CONGRESS_SERVICE" != "" ]; then - openstack service delete $CONGRESS_SERVICE -fi - -echo "Delete Congress database" -ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $CTLUSER@$CONGRESS_HOST "sudo mysql -e \"DROP DATABASE congress\"; exit" +openstack service delete congress echo "Delete Congress and other installed code in virtualenv" -rm -rf ~/congress +sudo rm -rf /opt/congress |