community.general.rabbitmq_exchange (0.1.1) — module

Manage rabbitMQ exchanges

Authors: Manuel Sousa (@manuel-sousa)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

This module uses rabbitMQ Rest API to create/delete exchanges


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create direct exchange
- rabbitmq_exchange:
    name: directExchange
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create topic exchange on vhost
- rabbitmq_exchange:
    name: topicExchange
    type: topic
    vhost: myVhost

Inputs

    
name:
    description:
    - Name of the exchange to create
    required: true

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Whether the exchange should be present or absent
    required: false

vhost:
    default: /
    description:
    - RabbitMQ virtual host.
    type: str

ca_cert:
    aliases:
    - cacert
    description:
    - CA certificate to verify SSL connection to management API.
    type: path

durable:
    default: true
    description:
    - whether exchange is durable or not
    required: false
    type: bool

internal:
    default: false
    description:
    - exchange is available only for other exchanges
    required: false
    type: bool

arguments:
    default: {}
    description:
    - extra arguments for exchange. If defined this argument is a key/value dictionary
    required: false

client_key:
    aliases:
    - key
    description:
    - Private key matching the client certificate.
    type: path

login_host:
    default: localhost
    description:
    - RabbitMQ host for connection.
    type: str

login_port:
    default: '15672'
    description:
    - RabbitMQ management API port.
    type: str

login_user:
    default: guest
    description:
    - RabbitMQ user for connection.
    type: str

auto_delete:
    default: false
    description:
    - if the exchange should delete itself after all queues/exchanges unbound from it
    required: false
    type: bool

client_cert:
    aliases:
    - cert
    description:
    - Client certificate to send on SSL connections to management API.
    type: path

exchange_type:
    aliases:
    - type
    choices:
    - fanout
    - direct
    - headers
    - topic
    default: direct
    description:
    - type for the exchange
    required: false

login_password:
    description:
    - RabbitMQ password for connection.
    type: str

login_protocol:
    choices:
    - http
    - https
    default: http
    description:
    - RabbitMQ management API protocol.
    type: str