From c8b921c6685859fe98d8b5602fa0bf959952c23e Mon Sep 17 00:00:00 2001 From: Jimmy McCrory Date: Tue, 11 Jun 2019 10:41:47 -0700 Subject: [PATCH] Check for undefined _oslomsg_rpc variables Some services may make use of notifications but do not require rpc messaging and have the _oslomsg_rpc variables undefined. Update the when clauses on the tasks configuring RabbitMQ for notifications to ignore undefined '_oslomsg_rpc_vhost' and '_oslomsg_rpc_userid' variables. Change-Id: I96e59b98e069bffb30c0d1851f777aa6b891f14f --- 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 4479809e..fb9068e2 100644 --- a/sync/tasks/mq_setup.yml +++ b/sync/tasks/mq_setup.yml @@ -67,7 +67,8 @@ name: "{{ _oslomsg_notify_vhost }}" state: "present" when: - - _oslomsg_notify_vhost != _oslomsg_rpc_vhost + - (_oslomsg_rpc_vhost is undefined) or + (_oslomsg_notify_vhost != _oslomsg_rpc_vhost) - name: Apply Notify RabbitMQ vhost policies rabbitmq_policy: @@ -78,7 +79,8 @@ vhost: "{{ _oslomsg_notify_vhost }}" loop: "{{ _oslomsg_notify_policies | default([]) + oslomsg_notify_policies }}" when: - - _oslomsg_notify_vhost != _oslomsg_rpc_vhost + - (_oslomsg_rpc_vhost is undefined) or + (_oslomsg_notify_vhost != _oslomsg_rpc_vhost) - name: Add Notify RabbitMQ user rabbitmq_user: @@ -92,7 +94,8 @@ force: true no_log: true when: - - _oslomsg_notify_userid != _oslomsg_rpc_userid + - (_oslomsg_rpc_userid is undefined) or + (_oslomsg_notify_userid != _oslomsg_rpc_userid) - name: Setup RPC MQ Service (Qdrouterd) delegate_to: "{{ _oslomsg_rpc_setup_host }}"