From d38c74355298285317598145b5f5bc9fec44b67e Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Wed, 7 Apr 2021 18:32:33 +0300 Subject: [PATCH] Run notify setup when setup_host differs There's a usecase, where all datasets might be the same, except setup_hosts. For example, when we use isolated rabbitmq cluster for RPC but shared one for notifications. And we have same set of users and vhosts there. In current state setup won't be performed, since vhosts and users are the same. Change-Id: Ib5c44327d5f1edc25bace79fdd057adabb0b4c14 --- sync/tasks/mq_setup.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sync/tasks/mq_setup.yml b/sync/tasks/mq_setup.yml index 3e2a3634..f435f7db 100644 --- a/sync/tasks/mq_setup.yml +++ b/sync/tasks/mq_setup.yml @@ -68,7 +68,8 @@ state: "present" when: - (_oslomsg_rpc_vhost is undefined) or - (_oslomsg_notify_vhost != _oslomsg_rpc_vhost) + (_oslomsg_notify_vhost != _oslomsg_rpc_vhost) or + (_oslomsg_notify_setup_host != _oslomsg_rpc_setup_host) - name: Apply Notify RabbitMQ vhost policies community.rabbitmq.rabbitmq_policy: @@ -80,7 +81,8 @@ loop: "{{ _oslomsg_notify_policies | default([]) + oslomsg_notify_policies }}" when: - (_oslomsg_rpc_vhost is undefined) or - (_oslomsg_notify_vhost != _oslomsg_rpc_vhost) + (_oslomsg_notify_vhost != _oslomsg_rpc_vhost) or + (_oslomsg_notify_setup_host != _oslomsg_rpc_setup_host) - name: Add Notify RabbitMQ user community.rabbitmq.rabbitmq_user: @@ -95,7 +97,8 @@ no_log: true when: - (_oslomsg_rpc_userid is undefined) or - (_oslomsg_notify_userid != _oslomsg_rpc_userid) + (_oslomsg_notify_userid != _oslomsg_rpc_userid) or + (_oslomsg_notify_setup_host != _oslomsg_rpc_setup_host) - name: Setup RPC MQ Service (Qdrouterd) delegate_to: "{{ _oslomsg_rpc_setup_host }}"