aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/rabbitmq_users.yml
blob: 98e45e2e35e0adbf4e91b748861a538a04e8ca5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
- name: rabbitmq_users | creating rabbitmq users
  rabbitmq_user:
    name: "{{ item['name'] }}"
    password: "{{ item['password'] }}"
    vhost: "{{ item['vhost'] }}"
    configure_priv: "{{ item['configure_priv'] }}"
    read_priv: "{{ item['read_priv'] }}"
    write_priv: "{{ item['write_priv'] }}"
    tags: "{{ item['tags'] }}"
    state: present
  become: true
  with_items: "{{ rabbitmq_users }}"
  when: >
        (rabbitmq_enable_clustering is defined and
          not rabbitmq_enable_clustering) or
          rabbitmq_enable_clustering is not defined

- name: rabbitmq_users | creating rabbitmq users
  rabbitmq_user:
    name: "{{ item['name'] }}"
    password: "{{ item['password'] }}"
    vhost: "{{ item['vhost'] }}"
    configure_priv: "{{ item['configure_priv'] }}"
    read_priv: "{{ item['read_priv'] }}"
    write_priv: "{{ item['write_priv'] }}"
    tags: "{{ item['tags'] }}"
    state: present
  run_once: yes
  become: true
  with_items: "{{ rabbitmq_users }}"
  when: >
        rabbitmq_enable_clustering is defined and
          rabbitmq_enable_clustering