diff options
Diffstat (limited to 'tasks')
-rw-r--r-- | tasks/rabbitmq_users.yml | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/tasks/rabbitmq_users.yml b/tasks/rabbitmq_users.yml index 7bba65e..d09d624 100644 --- a/tasks/rabbitmq_users.yml +++ b/tasks/rabbitmq_users.yml | |||
@@ -10,15 +10,14 @@ | |||
10 | tags: "{{ item['tags']|default(omit) }}" | 10 | tags: "{{ item['tags']|default(omit) }}" |
11 | permissions: "{{ item['permissions']|default(omit) }}" | 11 | permissions: "{{ item['permissions']|default(omit) }}" |
12 | state: present | 12 | state: present |
13 | run_once: rabbitmq_enable_clustering is defined and rabbitmq_enable_clustering | ||
14 | delegate_to: "{{ rabbitmq_master|default(omit) }}" | ||
13 | become: true | 15 | become: true |
14 | with_items: "{{ rabbitmq_users }}" | 16 | with_items: "{{ rabbitmq_users }}" |
15 | when: > | 17 | when: rabbitmq_debian_version is version('3.7.9', '<') |
16 | (rabbitmq_enable_clustering is defined and | ||
17 | not rabbitmq_enable_clustering) or | ||
18 | rabbitmq_enable_clustering is not defined | ||
19 | 18 | ||
20 | - name: rabbitmq_users | creating rabbitmq users | 19 | - name: rabbitmq_users | creating rabbitmq users (rabbit >= 3.7.9) |
21 | rabbitmq_user: | 20 | rabbitmq_user_3_7_9: |
22 | name: "{{ item['name'] }}" | 21 | name: "{{ item['name'] }}" |
23 | password: "{{ item['password'] }}" | 22 | password: "{{ item['password'] }}" |
24 | vhost: "{{ item['vhost']|default(omit) }}" | 23 | vhost: "{{ item['vhost']|default(omit) }}" |
@@ -28,10 +27,8 @@ | |||
28 | tags: "{{ item['tags']|default(omit) }}" | 27 | tags: "{{ item['tags']|default(omit) }}" |
29 | permissions: "{{ item['permissions']|default(omit) }}" | 28 | permissions: "{{ item['permissions']|default(omit) }}" |
30 | state: present | 29 | state: present |
31 | run_once: yes | 30 | run_once: rabbitmq_enable_clustering is defined and rabbitmq_enable_clustering |
32 | delegate_to: "{{ rabbitmq_master }}" | 31 | delegate_to: "{{ rabbitmq_master|default(omit) }}" |
33 | become: true | 32 | become: true |
34 | with_items: "{{ rabbitmq_users }}" | 33 | with_items: "{{ rabbitmq_users }}" |
35 | when: > | 34 | when: rabbitmq_debian_version is version('3.7.9', '>=') |
36 | rabbitmq_enable_clustering is defined and | ||
37 | rabbitmq_enable_clustering | ||