SHARE
TWEET

openstack tripleo unistaller

a guest Nov 15th, 2018 118 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # from: https://access.redhat.com/solutions/2210421
  3.  
  4. # services
  5. declare -a services=(
  6. neutron-dhcp-agent.service
  7. neutron-openvswitch-agent.service
  8. neutron-ovs-cleanup.service
  9. neutron-server.service
  10. openstack-ironic-inspector-dnsmasq.service
  11. openstack-nova-compute.service
  12. openstack-nova-conductor.service
  13. openstack-nova-scheduler.service
  14. openstack-swift-account-reaper.service
  15. openstack-swift-account.service
  16. openstack-swift-container-updater.service
  17. openstack-swift-container.service
  18. openstack-swift-object-updater.service
  19. openstack-swift-object.service
  20. openstack-swift-proxy.service
  21. openstack-zaqar.service
  22. openstack-zaqar@1.service
  23. keepalived
  24. )
  25.  
  26. # files
  27. declare -a files=(
  28. /home/stack/.instack
  29. /home/stack/stackrc
  30. /home/stack/undercloud-passwords.conf
  31. /home/stack/tripleo-undercloud-passwords.yaml
  32. /root/stackrc
  33. /root/tripleo-undercloud-passwords
  34. /var/lib/ironic-inspector
  35. /var/lib/mysql
  36. /var/lib/rabbitmq
  37. /var/opt/undercloud-stack
  38. /home/stack/tripleo-config-generated-env-files
  39. /home/stack/install-*
  40. /home/stack/undercloud-*
  41. /home/stack/ansible-errors.json
  42. )
  43.  
  44. # directories
  45. declare -a dirs=(
  46. /etc/puppet
  47. /etc/openvswitch
  48. /etc/ansible
  49. /etc/ceph
  50. /etc/ceilometer
  51. /etc/heat
  52. /etc/glance
  53. /etc/horizon
  54. /etc/ironic
  55. /etc/ironic-inspector
  56. /etc/keystone
  57. /etc/neutron
  58. /etc/nova
  59. /etc/swift
  60. /etc/haproxy
  61. /usr/share/openstack-*
  62. /usr/share/ansible*
  63. /usr/share/ceph-ansible
  64. /usr/share/container*
  65. /usr/share/heat
  66. /usr/share/instack-undercloud
  67. /usr/share/mysql/
  68. /usr/share/openvswitch
  69. /usr/share/puppet
  70. /usr/share/tripleo-*
  71. )
  72.  
  73. # packages
  74. declare -a pkgs=(
  75. rabbitmq-server
  76. mariadb
  77. haproxy
  78. openvswitch
  79. keepalived
  80. $(rpm -qa | grep openstack)
  81. $(rpm -qa | grep neutron)
  82. $(rpm -qa | grep swift)
  83. $(rpm -qa | grep puppet)
  84. $(rpm -qa | grep keystone)
  85. $(rpm -qa | grep oslo)
  86. $(rpm -qa | grep MySQL)
  87. $(rpm -qa | grep mariadb)
  88. $(rpm -qa | grep heat)
  89. $(rpm -qa | grep mistral)
  90. $(rpm -qa | grep ansible)
  91. $(rpm -qa | grep ceph)
  92. $(rpm -qa | grep tripleo)
  93. )
  94.  
  95. source stackrc
  96. env | grep OS_
  97.  
  98. # delete swift containers
  99. for i in $(swift list); do swift delete $i; done
  100.  
  101. # stop openstack services
  102. for i in ${services[*]}; do sudo systemctl stop $i; done
  103. for i in ${services[*]}; do sudo systemctl status $i; done
  104.  
  105. # remove files and directories
  106. for i in ${files[*]}; do sudo rm -rf $i; done
  107. for i in ${dirs[*]}; do sudo rm -rf $i; done
  108.  
  109. # remove pkgs
  110. for i in ${pkgs[*]}; do sudo yum remove -y $i; done
  111.  
  112. # restore networking
  113. mv  /etc/os-net-config/config.json  /etc/os-net-config/config.json.orig
  114. mv /etc/sysconfig/network-scripts/ifcfg-br-ctlplane /etc/sysconfig/network-scripts/orig.ifcfg-br-ctlplane
  115.  
  116. #stop and remove all docker containers & images
  117. docker stop $(docker ps -aq)
  118. docker rm $(docker ps -aq)
  119. docker rmi $(docker images -q)
  120.  
  121. ##EOF
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top