community.general.rabbitmq_binding (0.1.1) — module

Manage rabbitMQ bindings

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 APIs to create / delete bindings.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Bind myQueue to directExchange with routing key info
- rabbitmq_binding:
    name: directExchange
    destination: myQueue
    type: queue
    routing_key: info
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Bind directExchange to topicExchange with routing key *.info
- rabbitmq_binding:
    name: topicExchange
    destination: topicExchange
    type: exchange
    routing_key: '*.info'

Inputs

    
name:
    aliases:
    - src
    - source
    description:
    - source exchange to create binding on.
    required: true

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Whether the bindings should be present or absent.

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

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

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

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

destination:
    aliases:
    - dst
    - dest
    description:
    - destination exchange or queue for the binding.
    required: true

routing_key:
    default: '#'
    description:
    - routing key for the binding.

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

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

destination_type:
    aliases:
    - type
    - dest_type
    choices:
    - queue
    - exchange
    description:
    - Either queue or exchange.
    required: true