Created
April 20, 2016 13:59
-
-
Save fatherlinux/9dc8d19cf1162712884d2324c2926078 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@ose-osp software]# cat openstack-uninstall-all | |
PROPFIND /svn/fs/Users/mmyllyne/openstack/bin/openstack-unconfigure-all HTTP/1.1 | |
Host: ptapps.redhat.com | |
Depth: 0 | |
Content-Type: application/xml | |
Apply-To-Redirect-Ref: T | |
User-Agent: gvfs/1.4.3 | |
Authorization: Basic bW15bGx5bmU6cGFudHRlcmk= | |
Content-Length: 235 | |
#!/bin/sh | |
# Erase VMs | |
for vm in $(virsh list --all 2>/dev/null|grep instance-|awk '{print $2}'); do | |
virsh destroy $vm > /dev/null 2>&1 | |
virsh undefine --remove-all-storage $vm > /dev/null 2>&1 | |
done | |
systemctl stop libvirtd.service > /dev/null 2>&1 | |
iscsiadm -m node -U all > /dev/null 2>&1 | |
for t in $(targetcli "ls /backstores/block" 2>/dev/null | awk '/iqn/ {print $2}'); do | |
targetcli "/backstores/block/ delete $t" > /dev/null 2>&1 | |
done | |
# Remove all OSP packages | |
yum remove -y "*nagios*" "*puppet*" "libvirt*" "*openstack*" "rabbitmq*" \ | |
"*nova*" "*keystone*" "*glance*" "*cinder*" "*swift*" "*heat*" "*neutron*" \ | |
"*horizon*" "*ceilometer*" "*trove*" "*mariadb*" httpd "*memcache*" \ | |
"*scsi*utils" perl-DBI perl-DBD-MySQL "gluster*" python-taskflow "target*" \ | |
openvswitch "rhos*" "*oslo*" "*amqp*" "facter*" "hiera*" "ghostscript*" \ | |
"*mongo*" nrpe netcf-libs galera 2>&1 | grep -v "No Match for argument" | |
# Kill any leftover processes | |
killall -9 dnsmasq tgtd httpd > /dev/null 2>&1 | |
ps -ef | grep -i repli | grep swift | awk '{print $2}' | xargs kill > /dev/null 2>&1 | |
ps -ef | grep -i neutr | awk '{print $2}' | xargs kill > /dev/null 2>&1 | |
ps -ef | grep -i nova- | awk '{print $2}' | xargs kill > /dev/null 2>&1 | |
umount /srv/node/device* > /dev/null 2>&1 | |
umount /srv/loopback-device/swift_loopback > /dev/null 2>&1 | |
# Delele all local data | |
rm -rf /etc/nagios /root/.my.cnf /root/.*client /root/.targetcli \ | |
/var/lib/mysql /var/lib/glance /var/lib/nova /etc/nova /etc/swift \ | |
/srv/node/device*/* /var/lib/cinder /etc/rsync.d/frag* /etc/neutron \ | |
/var/cache/swift /var/log/keystone /var/tmp/packstack /etc/openvswitch \ | |
/var/lib/ceilometer /etc/ceilometer /etc/libvirt /etc/iscsi /etc/heat \ | |
/var/log/neutron /var/log/openvswitch /root/keystonerc_* /root/.my.cnf \ | |
/var/log/heat /var/log/horizon /var/log/httpd /var/lib/mongodb /etc/target \ | |
/var/lib/neutron /srv/loopback-device /srv/node /tmp/.secret_key_store \ | |
/var/log/libvirt /usr/share/openstack-puppet /usr/share/openstack-dashboard | |
rm -rf /var/log/nova /var/log/glance /var/log/swift /var/log/keystone \ | |
/var/log/ceilometer /var/lib/libvirt /var/lib/puppet /etc/cinder /etc/httpd \ | |
/etc/glance /etc/systemd/system/multi-user.target.wants/openstack* \ | |
/tmp/keystone* /var/lib/keystone /var/lib/rabbitmq /var/log/cinder \ | |
/var/log/rabbitmq /var/log/mariadb /etc/keystone /etc/lvm/archive/cinder* \ | |
/etc/my.* /etc/mysql /etc/rabbitmq /var/spool/cron/keystone /etc/pki/galera \ | |
/etc/openstack-dashboard /var/spool/nagios /var/log/nagios /var/log/mongodb \ | |
/etc/sysconfig/iptables.save /etc/pki/CA/index.txt* /etc/pki/CA/cacert.pem \ | |
/etc/pki/CA/serial* /etc/pki/tls/certs/ps_generate_ssl_certs.ssh \ | |
/etc/pki/tls/certs/localhost.crt /etc/pki/CA/newcerts/10.pem \ | |
/etc/pki/CA/private/cakey.pem /etc/pki/tls/private/localhost.key \ | |
/tmp/keystone* /tmp/yum* /var/cache/keystone | |
find /etc/pki/tls -name "ssl_ps*" | xargs rm -rf | |
find /etc/ -name "*neutron*" | xargs rm -f | |
find /etc/ -name "*.rpmsave" | xargs rm -f | |
# Restore default iptables configuration | |
cat <<EOF> /etc/sysconfig/iptables | |
*filter | |
:INPUT ACCEPT [0:0] | |
:FORWARD ACCEPT [0:0] | |
:OUTPUT ACCEPT [0:0] | |
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT | |
-A INPUT -p icmp -j ACCEPT | |
-A INPUT -i lo -j ACCEPT | |
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT | |
-A INPUT -j REJECT --reject-with icmp-host-prohibited | |
-A FORWARD -j REJECT --reject-with icmp-host-prohibited | |
COMMIT | |
EOF | |
systemctl stop iptables.service > /dev/null 2>&1 | |
# Misc | |
vgremove -f cinder-volumes > /dev/null 2>&1 | |
losetup -a | sed -e 's/:.*//g' | xargs losetup -d > /dev/null 2>&1 | |
sed -i -e '/cinder/d' /etc/rc.d/rc.local | |
sed -i -e '/swift/d' /etc/fstab | |
rm -rf /var/li |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment