Skip to content

maltris/ansible-rabbitmq

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rabbitmq

This role configures RabbitMQ cluster. This playbook is derived from alexeymedvedchikov.rabbitmq but adds the ability to use FQDN.

Requirements

Clustering requires proper short hostname resolution on every node in cluster. Use some /etc/hosts setup role for this. All other requirements are listed in metadata file.

Role Variables

The variables that can be passed to this role and a brief description about them are as follows.

# Set /var/lib/rabbitmq/.erlang.cookie
rabbitmq_erlang_cookie: 1qa2ws3ed

# Set max open files for rabbit process 
rabbitmq_ulimit_open_files: 1024

# Set the memory threshold at which the flow control is triggered
rabbitmq_memory_high_watermark: 0.4

# Use cluster or no
rabbitmq_create_cluster: no

# Short hostname of cluster master, on master node it must be specified too
rabbitmq_cluster_master: localhost

# Vhosts to create
rabbitmq_vhosts: []

# Enabled plugins
rabbitmq_plugins:
  - rabbitmq_management

# Users to create, self explained parameters
rabbitmq_users:
  - user: admin
    password: admin
    vhost: /
    configure_priv: .*
    read_priv: .*
    write_priv: .*
    tags: administrator

# Users to remove
rabbitmq_users_removed:
  - guest

   # Use FQDN
   rabbitmq_use_longname: 'true'

Examples

First of all you need configure /etc/hosts:

[all]
hosts:
  - { ip: '10.0.0.1', domain: 'mq1' }
  - { ip: '10.0.0.2', domain: 'mq2' }
  - { ip: '10.0.0.3', domain: 'mq3' }
  - { ip: '10.0.0.4', domain: 'mq4' }

[rabbidz]
mq1.local rabbitmq_cluster_master=mq2
mq2.local rabbitmq_cluster_master=mq2
mq3.local rabbitmq_cluster_master=mq3
mq4.local rabbitmq_cluster_master=mq3

[rabbidz:vars]
rabbitmq_create_cluster=yes

or you can use group variables (preferably)

[rabbit-mq]
mq1.local
mq2.local

[rabbit-mq:vars]
rabbitmq_create_cluster=yes
rabbitmq_cluster_master=mq3

[rabbit-mq-2]
mq3.local
mq4.local

[rabbit-mq-2:vars]
rabbitmq_create_cluster=yes
rabbitmq_cluster_master=mq3

License

LGPL

Author Information

  • Alexey Medvedchikov, 2GIS, LLC

Additional Information

This is a experimental fork from /alexey-medvedchikov/ansible-rabbitmq because of /alexey-medvedchikov/issues/36.

About

Ansible role configuring RabbitMQ cluster

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%