Leave only unique policies for __mq_policies

This change aims to merge 2 lists together by leaving only unique policies
by their name. With that, the one provided to the the role during include
will have prescedence over the default one.

Change-Id: If4d51a0ec6c746c35f436bea1be5b5e403bd0586
This commit is contained in:
Dmitriy Rabotyagov 2024-03-25 15:26:22 +01:00
parent 255f773294
commit c6969cc3cc
1 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@
block:
- name: Setup RPC vhost and policies
vars:
__mq_policies: "{{ _oslomsg_rpc_policies | default([]) + oslomsg_rpc_policies }}"
__mq_policies: "{{ (_oslomsg_rpc_policies | default([]) + oslomsg_rpc_policies) | unique(attribute=name) }}"
include_tasks: rabbit_vhost_setup.yml
loop: "{{ __resolved_oslomsg_rpc_vhost }}"
loop_control:
@ -49,7 +49,7 @@
block:
- name: Setup Notify vhost and policies
vars:
__mq_policies: "{{ _oslomsg_notify_policies | default([]) + oslomsg_notify_policies }}"
__mq_policies: "{{ (_oslomsg_notify_policies | default([]) + oslomsg_notify_policies) | unique(attribute=name) }}"
include_tasks: rabbit_vhost_setup.yml
loop: "{{ __resolved_oslomsg_notify_vhost }}"
loop_control: