rockandska.rabbitmq

Ansible Role: RabbitMQ

This is an Ansible role that helps you install RabbitMQ from its official repository. It can be found on Ansible Galaxy.

Ansible Galaxy Rating: Galaxy Score

Travis CI Build Status: Build Status

Compatibility

RabbitMQ Version
3.6.x Deprecated
3.7.x Deprecated
3.8 OK
> 3.8 Not tested
Supported OS
CentOS 7 OK
CentOS > 7 Not tested
Debian 9 OK
Debian > 9 Not tested
Ubuntu Bionic OK
Ubuntu > Bionic Not tested

Requirements on Remote Hosts

For all distributions

  • Install the ansible-role-erlang (make sure to use a compatible Erlang version for your RabbitMQ).
  • Ensure socat is installed.
  • Ensure logrotate is installed.
  • Ensure Python's requests library is version 1.0.0 or higher (if using bindings, exchanges, or queues management provided by this role).
  • For a RabbitMQ cluster, all hosts must be reachable by their hostnames.

For Debian / Ubuntu

  • Ensure apt-transport-https is installed.
  • Ensure gpg-agent is installed.
  • Ensure ca-certificates is installed.

For CentOS / RedHat

  • Ensure gnupg2 is installed.

Role Variables

Default variables are located in defaults/main.yml.

Here are some important variables:

  • rabbitmq_series: This defines the RabbitMQ version to install (3.8 is default).
  • rabbitmq_rpm_repo_url: Base URL for the RPM repository.
  • rabbitmq_deb_repo_url: Base URL for the Debian repository.
  • rabbitmq_sysctl_tpl: Path to the RabbitMQ sysctl config template (specific for versions >= 3.7).

Example Variable Setup

rabbitmq_series: 3.8
rabbitmq_users_to_create:
  - user: admin
    password: admin
    vhost: vhost_test
    configure_priv: .*
    read_priv: .*
    write_priv: .*
    tags: administrator

Example Playbooks

Standalone Setup

- hosts: rabbitmq
  roles:
    - rockandska.erlang
    - rockandska.rabbitmq

Cluster Setup

To set up a cluster, start the master node first, then add the slaves.

- hosts: rabbitmq-master
  roles:
    - role: rockandska.erlang
    - role: rockandska.rabbitmq
      vars:
        rabbitmq_is_master: true

- hosts: rabbitmq-slave
  roles:
    - role: rockandska.erlang
    - role: rockandska.rabbitmq
      vars:
        rabbitmq_slave_of: rabbitmq-master

Local Testing

Requirements

  • Python 3 (less than 3.8)
  • Docker

Run Tests

To execute the test suite, run:

$ make test

After the initial run, additional targets will be available for testing specific scenarios.

For more information about testing with Molecule, check their documentation.

License

This role is licensed under the BSD license.

Informazioni sul progetto

RabbitMQ (HA compatible)

Installa
ansible-galaxy install rockandska.rabbitmq
Licenza
Unknown
Download
12.1k
Proprietario