Skip to content

Commit cdca72e

Browse files
committed
Update rabbitmq-reset for Epoxy
With the introduction of oslo.messaging Queue Manager, we need to clear shared memory when wiping queues from RabbitMQ. This is because oslo.messaging assumes that a queue with an entry under shared memory exists in the RabbitMQ cluster. With the introduction of durable queues for reply/fanout queues, we need stop the services before wiping queues from RabbitMQ. This is because fanout queues in particular are not just created on container startup, so services may attempt to use them after the RabbitMQ state has been reset. Removes the tags as it no longer makes sense to only run part of this playbook.
1 parent 77ea637 commit cdca72e

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

etc/kayobe/ansible/rabbitmq-reset.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,25 @@
22
# Reset a broken RabbitMQ cluster.
33
# Also restarts all OpenStack services using RabbitMQ.
44

5+
- name: Stop OpenStack services
6+
hosts: controllers:compute:storage
7+
become: true
8+
gather_facts: false
9+
tasks:
10+
# The following services use RabbitMQ.
11+
- name: Stop OpenStack services
12+
ansible.builtin.shell:
13+
cmd: >-
14+
set -o pipefail &&
15+
systemctl -a | egrep 'kolla-(barbican|blazar|cinder|cloudkitty|designate|heat|ironic|keystone|magnum|manila|neutron|nova|octavia)' |
16+
awk '{ print $NF }' |
17+
xargs systemctl stop
18+
executable: "/bin/bash"
19+
520
- name: Reset RabbitMQ
621
hosts: controllers
722
become: true
823
gather_facts: false
9-
tags:
10-
- rabbitmq-reset
1124
vars:
1225
container_name: rabbitmq
1326
tasks:
@@ -59,18 +72,21 @@
5972
ansible.builtin.command: docker exec {{ container_name }} /bin/bash -c 'rabbitmqctl await_online_nodes {{ groups['controllers'] | length }}'
6073

6174
- name: Restart OpenStack services
62-
hosts: controllers:compute
75+
hosts: controllers:compute:storage
6376
become: true
6477
gather_facts: false
65-
tags:
66-
- restart-openstack
6778
tasks:
79+
- name: Clear shared memory
80+
ansible.builtin.shell:
81+
cmd: >
82+
rm -rf /dev/shm/*_qmanager
83+
6884
# The following services use RabbitMQ.
6985
- name: Restart OpenStack services
7086
ansible.builtin.shell:
7187
cmd: >-
7288
set -o pipefail &&
7389
systemctl -a | egrep 'kolla-(barbican|blazar|cinder|cloudkitty|designate|heat|ironic|keystone|magnum|manila|neutron|nova|octavia)' |
74-
awk '{ print $1 }' |
90+
awk '{ print $NF }' |
7591
xargs systemctl restart
7692
executable: "/bin/bash"

0 commit comments

Comments
 (0)