community.rabbitmq.rabbitmq_vhost module – Manage the state of a virtual host in RabbitMQ

Note

This module is part of the community.rabbitmq collection (version 1.6.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_vhost.

Synopsis

  • Manage the state of a virtual host in RabbitMQ using rabbitmqctl or REST APIs.

Parameters

Parameter

Comments

ca_cert

path

added in community.rabbitmq 1.5.0

CA certificate to verify SSL connection to management API.

client_cert

path

added in community.rabbitmq 1.5.0

Client certificate to send on SSL connections to management API.

client_key

path

added in community.rabbitmq 1.5.0

Private key matching the client certificate.

login_host

string

added in community.rabbitmq 1.5.0

RabbitMQ host for connection.

login_password

string

added in community.rabbitmq 1.5.0

RabbitMQ password for connection.

login_port

string

added in community.rabbitmq 1.5.0

RabbitMQ management API port.

Default: "15672"

login_protocol

string

added in community.rabbitmq 1.5.0

RabbitMQ management API protocol.

Choices:

  • "http" ← (default)

  • "https"

login_user

string

added in community.rabbitmq 1.5.0

RabbitMQ user for connection.

name

aliases: vhost

string / required

The name of the vhost to manage

node

string

erlang node name of the rabbit we wish to configure

Default: "rabbit"

state

string

The state of vhost

Choices:

  • "present" ← (default)

  • "absent"

tracing

aliases: trace

boolean

Enable/disable tracing for a vhost

Choices:

  • false ← (default)

  • true

Examples

- name: Ensure that the vhost /test exists.
  community.rabbitmq.rabbitmq_vhost:
    name: /test
    state: present

- name: Ensure that the vhost /test exists using REST APIs.
  community.rabbitmq.rabbitmq_vhost:
    name: /test
    state: present
    login_host: localhost
    login_user: admin
    login_password: changeadmin

Authors

  • Chris Hoffman (@chrishoffman)