rabbitmq_policy – Manage the state of policies in RabbitMQ — Ansible Documentation

- AnsibleFest
- Products
- Community
- Webinars & Training
- Blog

Documentation

# rabbitmq_policy – Manage the state of policies in RabbitMQ

- Synopsis

- Parameters

- Examples

- Status

## Synopsis

- Manage the state of a policy in RabbitMQ.

## Parameters

Parameter | Choices/Defaults | Comments
--- | --- | ---
apply_to - | Choices: all ← exchanges queues | What the policy applies to. Requires RabbitMQ 3.2.0 or later.
name - / required |  | The name of the policy to manage.
node - | Default: "rabbit" | Erlang node name of the rabbit we wish to configure.
pattern - | Default: null | A regex of queues to apply the policy to. Required when `state=present`. This option is no longer required as of Ansible 2.9.
priority - | Default: 0 | The priority of the policy.
state - | Choices: present ← absent | The state of the policy.
tags - | Default: null | A dict or string describing the policy. Required when `state=present`. This option is no longer required as of Ansible 2.9.
vhost - | Default: "/" | The name of the vhost to apply to.

## Examples

    - name: ensure the default vhost contains the HA policy via a dict
      rabbitmq_policy:
        name: HA
        pattern: .*
      args:
        tags:
          ha-mode: all

    - name: ensure the default vhost contains the HA policy
      rabbitmq_policy:
        name: HA
        pattern: .*
        tags:
          ha-mode: all

## Status

- This module is not guaranteed to have a backwards compatible interface. [preview]

- This module is maintained by the Ansible Community. [community]

### Authors

- John Dewey (@retr0h)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.