openstack-ansible-ops/rabbit-rescue
Henry Bonath 479288fccf Add "rabbit-rescue" script
This script was created to fix a broken/blank RabbitMQ install.
It was found useful to some other OSA operators and is being added here.

Change-Id: Ibd81a839e9cba1de6980d46a01f0df0ea68eb77d
2020-03-18 23:38:11 -04:00
..
README.md Add "rabbit-rescue" script 2020-03-18 23:38:11 -04:00
rabbit-rescue.sh Add "rabbit-rescue" script 2020-03-18 23:38:11 -04:00

README.md

Rabbit-Rescue

Use this script to rebuild the vhosts and permissions in Rabbitmq in case it gets borked.
(Don't even ask how I managed to do this...)

This script is loosely based on informatoin gleaned from this RedHat article, and was added to this repo based on this conversation.
Apparently I'm not the only one who has inadvertently destroyed their RabbitMQ installation, so this may be helpful to others in the future.

Note: For clustered installations, this needs to run only on a single node.

Usage:

  • Clone this repo into /opt on your deployment host.

  • Edit the Bash array all_services and populate with the services you were using in RabbitMQ.

  • Populate the service secrets with the information found in your /etc/openstack_deploy/user_secrets.yml file.

    • (this is quite possibly something we could try to do automatically in a future update)
  • Execute this from the deployment host, targeting one of your RabbitMQ containers:

    • # cd /opt/openstack-ansible
      # ansible rabbit_mq_container -m copy -a 'src=/opt/openstack-ops/rabbit-rescue/rabbit-rescue.sh dest=/tmp/rabbit-rescue.sh mode=preserve'
      # ansible rabbit_mq_container -m shell -a '/tmp/rabbit-rescue.sh'
      
    • Profit!

Alternative Usage:

  • Copy the script file down to one of your RabbitMQ Containers.

  • Edit the contents per the above instructions, and execute it.