community.rabbitmq.rabbitmq_plugin – Manage RabbitMQ plugins

Note

This plugin is part of the community.rabbitmq collection (version 1.1.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.rabbitmq.

To use it in a playbook, specify: community.rabbitmq.rabbitmq_plugin.

Synopsis

  • This module can be used to enable or disable RabbitMQ plugins.

Parameters

Parameter

Comments

broker_state

string

Specify whether the broker should be online or offline for the plugin change.

Choices:

  • online ← (default)

  • offline

names

aliases: name

string / required

Comma-separated list of plugin names. Also, accepts plugin name.

new_only

boolean

Only enable missing plugins.

Does not disable plugins that are not in the names list.

Choices:

  • no ← (default)

  • yes

prefix

string

Specify a custom install prefix to a Rabbit.

state

string

Specify if plugins are to be enabled or disabled.

Choices:

  • enabled ← (default)

  • disabled

Examples

- name: Enables the rabbitmq_management plugin
  community.rabbitmq.rabbitmq_plugin:
    names: rabbitmq_management
    state: enabled

- name: Enable multiple rabbitmq plugins
  community.rabbitmq.rabbitmq_plugin:
    names: rabbitmq_management,rabbitmq_management_visualiser
    state: enabled

- name: Disable plugin
  community.rabbitmq.rabbitmq_plugin:
    names: rabbitmq_management
    state: disabled

- name: Enable every plugin in list with existing plugins
  community.rabbitmq.rabbitmq_plugin:
    names: rabbitmq_management,rabbitmq_management_visualiser,rabbitmq_shovel,rabbitmq_shovel_management
    state: enabled
    new_only: 'yes'

- name: Enables the rabbitmq_peer_discovery_aws plugin without requiring a broker connection.
  community.rabbitmq.rabbitmq_plugin:
    names: rabbitmq_peer_discovery_aws_plugin
    state: enabled
    broker_state: offline

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

disabled

list / elements=string

list of plugins disabled during task run

Returned: always

Sample: [“rabbitmq_management”]

enabled

list / elements=string

list of plugins enabled during task run

Returned: always

Sample: [“rabbitmq_management”]

Authors

  • Chris Hoffman (@chrishoffman)