Skip to content

Instantly share code, notes, and snippets.

@kedare
Created May 30, 2017 13:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kedare/c3cd382ba57277010671e1c065225b18 to your computer and use it in GitHub Desktop.
Make sure RabbitMQ is running on Docker:
dockerng.running:
- name: {{ pillar["application_environment"] }}-rabbitmq
- image: rabbitmq:management
- port_bindings: "5672:5672,15672:15672"
{% for vhost in pillar["rabbitmq"]["vhosts"] %}
Create the {{ vhost }} RabbitMQ VHost:
rabbitmq_vhost.present:
- name: vhost
{% endfor %}
{% for user in pillar["rabbitmq"]["users"] %}
Create the {{ user["name"] }} RabbitMQ user:
rabbitmq_user.present:
- name: {{ user["name"] }}
- password: {{ user["password"]}}
- tags:
- {{ pillar["application_environment"] }}
- perms:
{% for vhost in user["vhosts"] %}
- {{ vhost }}:
- ".*"
- ".*"
- ".*"
{% endfor %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment