W3cubDocs

/Ansible

community.rabbitmq.rabbitmq_exchange – Manage rabbitMQ exchanges

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_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 Choices/Defaults Comments
arguments
dictionary
Default:
{}
extra arguments for exchange. If defined this argument is a key/value dictionary
auto_delete
boolean
    Choices:
  • no
  • yes
if the exchange should delete itself after all queues/exchanges unbound from it
ca_cert
path
CA certificate to verify SSL connection to management API.

aliases: cacert
client_cert
path
Client certificate to send on SSL connections to management API.

aliases: cert
client_key
path
Private key matching the client certificate.

aliases: key
durable
boolean
    Choices:
  • no
  • yes
whether exchange is durable or not
exchange_type
string
    Choices:
  • fanout
  • direct
  • headers
  • topic
  • x-delayed-message
type for the exchange

aliases: type
internal
boolean
    Choices:
  • no
  • yes
exchange is available only for other exchanges
login_host
string
Default:
"localhost"
RabbitMQ host for connection.
login_password
string
Default:
"guest"
RabbitMQ password for connection.
login_port
string
Default:
"15672"
RabbitMQ management API port.
login_protocol
string
    Choices:
  • http
  • https
RabbitMQ management API protocol.
login_user
string
Default:
"guest"
RabbitMQ user for connection.
name
string / required
Name of the exchange to create
state
string
    Choices:
  • present
  • absent
Whether the exchange should be present or absent
vhost
string
Default:
"/"
RabbitMQ virtual host.

Examples

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

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

Authors

  • Manuel Sousa (@manuel-sousa)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/rabbitmq/rabbitmq_exchange_module.html