Allow to provide policy state

It might be desired by deployer to remove already applied policy.
For that policy state should be explicitly passeda as absent
for the module.

Change-Id: I24bb110998eef978daf618964c1ee3713eb6b339
This commit is contained in:
Dmitriy Rabotyagov 2021-11-30 21:10:18 +02:00
parent 52e3978312
commit bf5da3b7fa
2 changed files with 7 additions and 0 deletions

View File

@ -261,6 +261,12 @@ rabbitmq_disable_non_tls_listeners: False
# pattern: '^(event|metering|notifications)\.'
# tags: "ha-sync-mode=automatic"
# priority: 0
# state:present
# If policy needs to be removed, provide `state: absent`
# - name: "HA"
# pattern: '^(?!(amq\.)|(.*_fanout_)|(reply_)).*'
# tags: "ha-mode=all"
# state: absent
#
rabbitmq_policies: []
rabbitmq_apply_openstack_policies: False

View File

@ -88,6 +88,7 @@
name: "{{ item.name }}"
pattern: "{{ item.pattern }}"
priority: "{{ item.priority | default(0) }}"
state: "{{ item.state | default(omit) }}"
tags: "{{ item.tags }}"
register: rabbitmq_policy
loop: "{{ (rabbitmq_apply_openstack_policies | bool) | ternary(rabbitmq_openstack_policies + rabbitmq_policies, rabbitmq_policies) }}"