community.rabbitmq.rabbitmq_exchange module – Manage rabbitMQ exchanges

Note

This module is part of the community.rabbitmq collection (version 1.2.2).

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_exchange.

Synopsis

  • This module uses rabbitMQ Rest API to create/delete exchanges

Requirements

The below requirements are needed on the host that executes this module.

  • requests >= 1.0.0

Parameters

Parameter

Comments

arguments

dictionary

extra arguments for exchange. If defined this argument is a key/value dictionary

Default: {}

auto_delete

boolean

if the exchange should delete itself after all queues/exchanges unbound from it

Choices:

  • no ← (default)

  • yes

ca_cert

aliases: cacert

path

CA certificate to verify SSL connection to management API.

client_cert

aliases: cert

path

Client certificate to send on SSL connections to management API.

client_key

aliases: key

path

Private key matching the client certificate.

durable

boolean

whether exchange is durable or not

Choices:

  • no

  • yes ← (default)

exchange_type

aliases: type

string

type for the exchange

Choices:

  • fanout

  • direct ← (default)

  • headers

  • topic

  • x-delayed-message

internal

boolean

exchange is available only for other exchanges

Choices:

  • no ← (default)

  • yes

login_host

string

RabbitMQ host for connection.

Default: “localhost”

login_password

string

RabbitMQ password for connection.

Default: “guest”

login_port

string

RabbitMQ management API port.

Default: “15672”

login_protocol

string

RabbitMQ management API protocol.

Choices:

  • http ← (default)

  • https

login_user

string

RabbitMQ user for connection.

Default: “guest”

name

string / required

Name of the exchange to create

state

string

Whether the exchange should be present or absent

Choices:

  • present ← (default)

  • absent

vhost

string

RabbitMQ virtual host.

Default: “/”

Examples

- name: Create direct exchange
  community.rabbitmq.rabbitmq_exchange:
    name: directExchange

- name: Create topic exchange on vhost
  community.rabbitmq.rabbitmq_exchange:
    name: topicExchange
    type: topic
    vhost: myVhost

Authors

  • Manuel Sousa (@manuel-sousa)