kolla-ansible/ansible/roles/nova-cell/tasks/rabbitmq.yml
wu.chunyang 24d08142d2 Fix nova deployment failure when rabbitmq is disabled
Nova always tries to create the rabbitmq user regardless of
whether RabbitMQ is enabled or not.
This ps also adds an external rabbitmq doc.

Change-Id: Iec517226e4c82ea351889b55689a3efceaadcc76
2021-07-27 22:07:08 +08:00

30 lines
1.2 KiB
YAML

---
# Create RabbitMQ users and vhosts.
- block:
- import_role:
name: service-rabbitmq
vars:
service_rabbitmq_users: "{{ nova_cell_rpc_rabbitmq_users }}"
# Create users for cells in parallel.
service_rabbitmq_run_once: false
service_rabbitmq_when: "{{ inventory_hostname == groups[nova_cell_conductor_group][0] | default }}"
# Delegate to a host in the RPC group.
service_rabbitmq_delegate_host: "{{ groups[nova_cell_rpc_group_name][0] | default }}"
- import_role:
name: service-rabbitmq
vars:
service_rabbitmq_users: "{{ nova_cell_notify_rabbitmq_users }}"
# Create users for cells in parallel.
service_rabbitmq_run_once: false
service_rabbitmq_when: "{{ inventory_hostname == groups[nova_cell_conductor_group][0] | default }}"
# Delegate to a host in the notify group.
service_rabbitmq_delegate_host: "{{ groups[nova_cell_notify_group_name][0] | default }}"
when:
- nova_cell_rpc_group_name != nova_cell_notify_group_name or
nova_cell_rpc_rabbitmq_users != nova_cell_notify_rabbitmq_users
when:
- nova_cell_rpc_transport == 'rabbit'
- enable_rabbitmq | bool