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: If09fdaf413ed6f8fd67624ff0edbf617edd126b1
This commit is contained in:
Dmitriy Rabotyagov 2024-03-07 18:07:49 +01:00
parent 255f773294
commit 6aaa281d2e
1 changed files with 1 additions and 0 deletions

View File

@ -22,6 +22,7 @@
community.rabbitmq.rabbitmq_policy:
name: "{{ policy.name }}"
pattern: "{{ policy.pattern }}"
apply_to: "{{ policy.apply_to | default(omit) }}"
priority: "{{ policy.priority | default(0) }}"
tags: "{{ policy.tags }}"
state: "{{ policy.state | default(omit) }}"