Install RabbitMQ, clustering, enable plugins, set users and policy for it with HAProxy & KeepAliveD for setup redundant service.
Use RabbitMQ example configuration to customize rabbitmq.conf jinja template.
For test this role you can use Molecule and Vagrant(Recommended).
Categorize target servers with 3 categories in inventory file:
Group | Description |
---|---|
rabbitmq-master | first node |
rabbitmq-slaves | other nodes |
rabbitmq-cluster | parent of 2 above groups |
For example: inventory.ini
[all]
rabbitmq01
rabbitmq02
rabbitmq03
[rabbitmq-master]
rabbitmq01
[rabbitmq-slaves]
rabbitmq02
rabbitmq03
[rabbitmq-cluster:children]
rabbitmq-master
rabbitmq-slaves
According to defaults, you find some variables that you can use on group_vars or host_vars in inventories directory.
Install community-based RabbitMQ Ansible collection:
ansible-galaxy collection install community.rabbitmq
---
- hosts: all
become: true
roles:
- rabbitmq
MIT
This role was created in 2023 by Mohammad Shahmaleki, for any suggestions and questions about this ansible role contact with me on Linkedin.