Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rabbitmq-reset for Epoxy #1491

Merged
merged 3 commits into from
Feb 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions etc/kayobe/ansible/rabbitmq-reset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,25 @@
# Reset a broken RabbitMQ cluster.
# Also restarts all OpenStack services using RabbitMQ.

- name: Stop OpenStack services
hosts: controllers:compute:storage
become: true
gather_facts: false
tasks:
# The following services use RabbitMQ.
- name: Stop OpenStack services
ansible.builtin.shell:
cmd: >-
set -o pipefail &&
systemctl -a | egrep 'kolla-(barbican|blazar|cinder|cloudkitty|designate|heat|ironic|keystone|magnum|manila|neutron|nova|octavia)' |
awk '{ print $NF }' |
xargs systemctl stop
executable: "/bin/bash"

- name: Reset RabbitMQ
hosts: controllers
become: true
gather_facts: false
tags:
- rabbitmq-reset
vars:
container_name: rabbitmq
tasks:
Expand Down Expand Up @@ -59,18 +72,21 @@
ansible.builtin.command: docker exec {{ container_name }} /bin/bash -c 'rabbitmqctl await_online_nodes {{ groups['controllers'] | length }}'

- name: Restart OpenStack services
hosts: controllers:compute
hosts: controllers:compute:storage
become: true
gather_facts: false
tags:
- restart-openstack
tasks:
- name: Clear shared memory
ansible.builtin.shell:
cmd: >
rm -rf /dev/shm/*_qmanager

# The following services use RabbitMQ.
- name: Restart OpenStack services
ansible.builtin.shell:
cmd: >-
set -o pipefail &&
systemctl -a | egrep 'kolla-(barbican|blazar|cinder|cloudkitty|designate|heat|ironic|keystone|magnum|manila|neutron|nova|octavia)' |
awk '{ print $1 }' |
awk '{ print $NF }' |
xargs systemctl restart
executable: "/bin/bash"
Loading