Add support for the apply_to parameter for policies

Policies were always applied to target `all` aspects and
there was no way to have them target only e.g. exchanges.
This can be important though, see [1].

This change enables the use of the apply_to parmeter via the existing
variables while maintaining `all` to be the default.

[1] https://www.rabbitmq.com/docs/parameters#how-policies-work

Change-Id: I61d68c630599b8ef2382663e8a37fdc456435c11
This commit is contained in:
Christian Rohmann
2024-03-01 10:54:57 +01:00
parent e4c234dcdc
commit 1d9a0837e9
2 changed files with 6 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
features:
- |
RabbitMQ policies now support the `apply_to` parameter to e.g have a policy
target only classic_queues, exchanges, ...

View File

@@ -80,6 +80,7 @@
node: "rabbit@{{ ansible_facts['hostname'] }}" node: "rabbit@{{ ansible_facts['hostname'] }}"
name: "{{ item.name }}" name: "{{ item.name }}"
pattern: "{{ item.pattern }}" pattern: "{{ item.pattern }}"
apply_to: "{{ item.apply_to | default(omit) }}"
priority: "{{ item.priority | default(0) }}" priority: "{{ item.priority | default(0) }}"
state: "{{ item.state | default(omit) }}" state: "{{ item.state | default(omit) }}"
tags: "{{ item.tags }}" tags: "{{ item.tags }}"