tanadeau.ansible_role_rabbitmq
RabbitMQ Ansible Role
This role is based on the original from https://github.com/jasonroyle/ansible-role-rabbitmq. It was updated on August 20, 2018, to work with EL 7 and RabbitMQ version 3.7 or newer.
Version
For the version details, check:
You can specify the RabbitMQ version to install using the following variable:
rabbitmq_version: '3.8.1'
Users
For user management, refer to:
Define the users you want to create by setting the rabbitmq_users
variable like this:
rabbitmq_users:
- user: admin
password: admin
tags: administrator
Parameter | Required | Default | Choices | Comments |
---|---|---|---|---|
configure_priv | No | .* | ||
password | Yes | |||
read_priv | No | .* | ||
tags | No | |||
user | Yes | |||
vhost | No | / | ||
write_priv | No | .* |
Remove Users
To remove users, define them in rabbitmq_users_absent
like this:
rabbitmq_users_absent:
- guest
Virtual Hosts
For more on virtual hosts, see:
You can set up virtual hosts with the rabbitmq_vhosts
variable:
rabbitmq_vhosts:
- /one
- name: /two
node: rabbit
tracing: no
Parameter | Required | Default | Choices | Comments |
---|---|---|---|---|
name | Yes | |||
node | No | rabbit | ||
tracing | No | no |
|
Remove Virtual Hosts
Define virtual hosts to be removed using the following variable:
rabbitmq_vhosts_absent:
- /vhost
Plugins
For details on plugins, see:
Enable plugins by setting the rabbitmq_plugins
variable:
rabbitmq_plugins:
- rabbitmq_management
- name: rabbitmq_delayed_message_exchange
url: http://www.rabbitmq.com/community-plugins/v3.6.x/rabbitmq_delayed_message_exchange-0.0.1.ez
Parameter | Required | Default | Choices | Comments |
---|---|---|---|---|
name | Yes | |||
url | No | Installs the plugin |
Disable Plugins
To disable plugins, use the following variable:
rabbitmq_plugins_disabled:
- rabbitmq_management
Configuration
For configuration options, see:
Set configuration values with rabbitmq_config
like this:
rabbitmq_config:
listeners.tcp.default: 5672
To define environment variables, use rabbitmq_env
, without the "RABBITMQ_" prefix:
rabbitmq_env:
DIST_PORT: 25672
Cluster
For clustering information, see:
To enable clustering, set the rabbitmq_cluster
variable. For a quick guide, you can read this article on RabbitMQ clustering.
Make sure to define where the master node is located:
rabbitmq_cluster: yes
rabbitmq_cluster_master: "rabbit@rabbitmq1"
Default behavior includes:
- The first node in the group is considered the master.
- Queues are replicated across all nodes.
- You can replace non-master nodes easily.
- You cannot switch the master node without manual intervention.
Erlang Cookie
Set the rabbitmq_erlang_cookie
variable with the Erlang cookie:
rabbitmq_erlang_cookie: g9avtqdzdm2p5oe9
License
This role is licensed under the MIT License.
ansible-galaxy install tanadeau.ansible_role_rabbitmq