community.general.rabbitmq_user (0.1.1) — module

Manage RabbitMQ users

Authors: Chris Hoffman (@chrishoffman)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

Add or remove users to RabbitMQ and assign permissions

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Add user to server and assign full access control on / vhost.
# The user might have permission rules for other vhost but you don't care.
- rabbitmq_user:
    user: joe
    password: changeme
    vhost: /
    configure_priv: .*
    read_priv: .*
    write_priv: .*
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Add user to server and assign full access control on / vhost.
# The user doesn't have permission rules for other vhosts
- rabbitmq_user:
    user: joe
    password: changeme
    permissions:
      - vhost: /
        configure_priv: .*
        read_priv: .*
        write_priv: .*
    state: present

Inputs

    
node:
    default: rabbit
    description:
    - erlang node name of the rabbit we wish to configure

tags:
    description:
    - User tags specified as comma delimited

user:
    aliases:
    - username
    - name
    description:
    - Name of user to add
    required: true

force:
    default: 'no'
    description:
    - Deletes and recreates the user.
    type: bool

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Specify if user is to be added or removed

vhost:
    default: /
    description:
    - vhost to apply access privileges.
    - This option will be ignored when permissions option is used.

password:
    description:
    - Password of user to add.
    - To change the password of an existing user, you must also specify C(update_password=always).

read_priv:
    default: ^$
    description:
    - Regular expression to restrict configure actions on a resource for the specified
      vhost.
    - By default all actions are restricted.
    - This option will be ignored when permissions option is used.

write_priv:
    default: ^$
    description:
    - Regular expression to restrict configure actions on a resource for the specified
      vhost.
    - By default all actions are restricted.
    - This option will be ignored when permissions option is used.

permissions:
    default: []
    description:
    - a list of dicts, each dict contains vhost, configure_priv, write_priv, and read_priv,
      and represents a permission rule for that vhost.
    - This option should be preferable when you care about all permissions of the user.
    - You should use vhost, configure_priv, write_priv, and read_priv options instead
      if you care about permissions for just some vhosts.

configure_priv:
    default: ^$
    description:
    - Regular expression to restrict configure actions on a resource for the specified
      vhost.
    - By default all actions are restricted.
    - This option will be ignored when permissions option is used.

update_password:
    choices:
    - on_create
    - always
    default: on_create
    description:
    - C(on_create) will only set the password for newly created users.  C(always) will
      update passwords if they differ.
    required: false