Super Clean DevStack script

#!/bin/bash

#

# Eradicates an OpenStack install from devstack

#

# Assume all openstack components installed in same

# root directory at $DEST

source ./stackrc

# Destination path for installation “DEST`

DEST=${DEST:-/opt/stack}

NOVA_DIR=$DEST/nova

HORIZON_DIR=$DEST/horizon

GLANCE_DIR=$DEST/glance

KEYSTONE_DIR=$DEST/keystone

NOVACLIENT_DIR=$DEST/python-novaclient

KEYSTONECLIENT_DIR=$DEST/python-keystoneclient

NOVNC_DIR=$DEST/noVNC

SWIFT_DIR=$DEST/swift

QUANTUM_DIR=$DEST/quantum

QUANTUM_CLIENT_DIR=$DEST/python-quantumclient

MELANGE_DIR=$DEST/melange

MELANGECLIENT_DIR=$DEST/python-melangeclient

#

# Cleanup installation trees

#

sudo rm -rf $NOVA_DIR $HORIZON_DIR $GLANCE_DIR $KEYSTONE_DIR $NOVACLIENT_DIR $KEYSTONECLIENT_DIR $NOVNC_DIR $SWIFT_DIR $QUANTUM_DIR $QUANTUM_CLIENT_DIR $MELANGE_DIR $MELANGECLIENT_DIR

sudo rm -rf $DEST/nova-volumes-backing-file

#

# Cleanup MySQL data

#

sudo yum -y remove mysql-server

sudo rm -rf /var/lib/mysql

#

# Cleanup RabbitMQ data

#

sudo yum -y remove rabbitmq-server

sudo rm -rf /var/lib/rabbitmq

#

# Cleanup config dirs

#

sudo rm -rf /etc/swift /etc/nova /etc/glance /etc/keystone

sudo rm /etc/sudoers.d/50_stack_sh

sudo rm /etc/sudoers.d/nova-rootwrap

sudo rm /etc/rsyslog.d/90-stack-m.conf

#

# Kill off any stray swift instances

#

killall -TERM /usr/bin/python

killall -TERM stunnel

#

# Remove any mounts

#

IMAGE_MNT=$(egrep -q swift.img /proc/mounts)

#

# Cleanup installation trees

#

sudo rm -rf $NOVA_DIR $HORIZON_DIR $GLANCE_DIR $KEYSTONE_DIR $NOVACLIENT_DIR $KEYSTONECLIENT_DIR $NOVNC_DIR $SWIFT_DIR $QUANTUM_DIR $QUANTUM_CLIENT_DIR $MELANGE_DIR $MELANGECLIENT_DIR

sudo rm -rf $DEST/nova-volumes-backing-file

Leave a Reply

Your email address will not be published. Required fields are marked *