Coder Social home page Coder Social logo

rabbitmq's Introduction

Rabbitmq

Build Status @ master

Playbook that installs and configures RabbitMQ message broker.

Supports standalone or simple cluster deployment, it is based on Mayeu.RabbitMQ role, without SSL or federation support.

Installation

Use Ansible galaxy to install this playbook:

$ ansible-galaxy install openstack-ansible-galaxy.rabbitmq

Supported system

Ubuntu 14.04 (Trusty), Ubuntu 16.04 (Xenial), Ubuntu 18.04 (Bionic) and CentOS 7.x

Role Variables

Environment

Use rabbitmq_conf_env so set Environment variables such as NODENAME, HOSTNAME, RABBITMQ_USE_LONGNAME, NODE_PORT, NODE_IP_ADDRESS, etc.

Example:

rabbitmq_conf_env:
  NODENAME: rabbit1

Configuration file

rabbitmq_tcp_address - listening address for the tcp interface, such as 0.0.0.0.

rabbitmq_tcp_port - listening port for the tcp interface, such as 5672.

rabbitmq_cluster - a boolean variable, when set to True the role will add all nodes in a play group to a cluster setup in a configuration file. It depends on a ansible_play_hosts magic variable, found in ansible 2.2 or later.

rabbitmq_erlang_cookie - only used when rabbitmq_cluster is used, to identify members of a single cluster.

Plugins

rabbitmq_plugins - list of plugins to activate.

Users

rabbitmq_users - list of users, and associated vhost and password. Example on defining the users configuration:

rabbitmq_users:
  - user:     user1
    password: password1             # Optional, defaults to ""
    vhost:    vhost1                # Optional, defaults to "/"
    node:     node_name             # Optional, defaults to "rabbit"
    configure_priv: "^resource.*"   # Optional, defaults to ".*"
    read_priv: "^$"                 # Disallow reading (defaults to ".*")
    write_priv: "^$"                # Disallow writing (defaults to ".*")
  - user:     user2
    password: password2
    vhost:    vhost1
    force:    no
    tags:                           # Optional, user tags
    - administrator
  - user:     guest
    state:    absent                # Optional, removes user (defaults to "present")

Vhosts

rabbitmq_vhosts - list of vhosts to create. Example on defining the vhosts configuration:

rabbitmq_vhosts:
  - name:     vhost1
    node:     node_name             # Optional, defaults to "rabbit"
    tracing:  yes                   # Optional, defaults to "no"
    state:    present               # Optional, defaults to "present"

Policies

rabbitmq_policies - list of policies to be created (or removed if state: absent is set). Example on defining the policies configuration:

rabbitmq_policies:
  - name:     HA Policy
    vhost:    '/'                   # Optional, defaults to "/"
    pattern:  '.*'                  # Optional, defaults to ".*"
    tags:                           # Optional, defaults to "{}"
      ha-mode: all
      ha-sync-mode: automatic
    state:    present               # Optional, defaults to "present"

Cluster setup

This role supports setting up a simple cluster by adding all the nodes in a play group that uses the role. It adds the nodes to cluster_nodes section in rabbitmq.conf file. All the nodes are disc nodes. The role also sets the same "Erlang Cookie" to all the nodes belonging to a cluster. In this way nodes join the cluster automatically during the bootstrap.

For the initial deployment, it is advised to serialize the node deployment in a way that, at first, a single node is deployed, followed by all the other nodes in the second run. This would result in a consistent cluster setup. Playbook example:

  - hosts: rabbitmq
    become: True
    serial:
      - 1
      - '100%'
    roles:
      - rabbitmq

File descriptors

rabbitmq_fd_limit - set this to some numeric value to override 1024 default. Currently only supports systemd.

Testing

There is some tests that try to provision a VM using Vagrant. Just launch them with:

$ cd tests
$ vagrant up

License

BSD

rabbitmq's People

Contributors

sibradzic avatar abelboldu avatar ryo-tagami avatar sebashton avatar springwell avatar

Watchers

James Cloos avatar  avatar

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.