Execution
Date 08 Dec 2025 13:39:52 +0000
Duration 00:35:02.03
Controller aio1.openstack.local
User root
Versions
Ansible 2.18.6
ara 1.7.4 / 1.7.4
Python 3.12.3
Summary
2 Hosts
1377 Tasks
1365 Results
104 Plays
504 Files
0 Records

File: /etc/ansible/ansible_collections/openstack/osa/roles/mq_setup/tasks/main.yml

---
# Copyright 2018, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

- name: Setup RPC MQ Service (RabbitMQ)
  delegate_to: "{{ _oslomsg_rpc_setup_host }}"
  block:
    - name: Setup RPC vhost and policies
      vars:
        __mq_policies: "{{ (_oslomsg_rpc_policies | default([]) + oslomsg_rpc_policies) | unique(attribute='name') }}"
      ansible.builtin.include_tasks: rabbit_vhost_setup.yml
      loop: "{{ __resolved_oslomsg_rpc_vhost }}"
      loop_control:
        loop_var: __mq_vhost

    - name: Setup RPC user
      vars:
        __mq_nolog: "{{ _oslomsg_nolog | default(True) }}"
        __mq_userid: "{{ _oslomsg_rpc_userid }}"
        __mq_password: "{{ _oslomsg_rpc_password }}"
      ansible.builtin.include_tasks: rabbit_user_setup.yml
      loop: "{{ __resolved_oslomsg_rpc_vhost }}"
      loop_control:
        loop_var: __mq_vhost
  when:
    - "(_oslomsg_rpc_configure | default(_oslomsg_rpc_transport is defined))"
    - "(_oslomsg_rpc_transport is defined) and (_oslomsg_rpc_transport == 'rabbit')"
  tags:
    - common-rabbitmq

- name: Setup Notify MQ Service (RabbitMQ)
  delegate_to: "{{ _oslomsg_notify_setup_host }}"
  when:
    - "(_oslomsg_notify_configure | default(_oslomsg_notify_transport is defined))"
    - "(_oslomsg_notify_transport is defined) and (_oslomsg_notify_transport == 'rabbit')"
  tags:
    - common-rabbitmq
  block:
    - name: Setup Notify vhost and policies
      vars:
        __mq_policies: "{{ (_oslomsg_notify_policies | default([]) + oslomsg_notify_policies) | unique(attribute='name') }}"
      ansible.builtin.include_tasks: rabbit_vhost_setup.yml
      loop: "{{ __resolved_oslomsg_notify_vhost }}"
      loop_control:
        loop_var: __mq_vhost
      when:
        - (_oslomsg_rpc_vhost is undefined) or
          (_oslomsg_notify_vhost != _oslomsg_rpc_vhost) or
          (_oslomsg_notify_setup_host != _oslomsg_rpc_setup_host) or
          not (_oslomsg_rpc_configure | default(_oslomsg_rpc_transport is defined))

    - name: Setup Notify user
      vars:
        __mq_nolog: "{{ _oslomsg_nolog | default(True) }}"
        __mq_userid: "{{ _oslomsg_notify_userid }}"
        __mq_password: "{{ _oslomsg_notify_password }}"
      ansible.builtin.include_tasks: rabbit_user_setup.yml
      loop: "{{ __resolved_oslomsg_notify_vhost }}"
      loop_control:
        loop_var: __mq_vhost
      when:
        - (_oslomsg_rpc_userid is undefined) or
          (_oslomsg_notify_userid != _oslomsg_rpc_userid) or
          (_oslomsg_notify_setup_host != _oslomsg_rpc_setup_host) or
          not (_oslomsg_rpc_configure | default(_oslomsg_rpc_transport is defined))