Skip to content

Instantly share code, notes, and snippets.

@rektide
Created March 18, 2014 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rektide/9613213 to your computer and use it in GitHub Desktop.
Save rektide/9613213 to your computer and use it in GitHub Desktop.
rabbitmq one-act
---
- hosts: all
vars_prompt:
vhost: "Vhost name (optional)"
user: "User"
pw: "Optional password"
vars:
config_priv: ".*"
read_priv: ".*"
write_priv: ".*"
tasks:
- fail: msg="User required"
when: user is not defined or not user
- rabbitmq_vhost: name="{{vhost}}" state=present
when: not not vhost
- set_fact: vhost="/"
when: not vhost
- rabbitmq_user: read_priv="{{read_priv}}" write_priv="{{write_priv}}" configure_priv="{{config_priv}}" user="{{user}}" vhost="{{vhost}}" password="{{pw}}"
when: not not pw
- rabbitmq_user: read_priv="{{read_priv}}" write_priv="{{write_priv}}" configure_priv="{{config_priv}}" user="{{user}}" vhost="{{vhost}}"
when: not pw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment