Coder Social home page Coder Social logo

ansible-rabbitmq's Introduction

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)

[rabbidz1]
mq1.local
mq2.local

[rabbidz1:vars]
rabbitmq_create_cluster=yes
rabbitmq_cluster_master=mq3

[rabbidz2]
mq3.local
mq4.local

[rabbidz2:vars]
rabbitmq_create_cluster=yes
rabbitmq_cluster_master=mq3

License

LGPL

Author Information

  • Alexey Medvedchikov, 2GIS, LLC

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.