diff options
author | Paul Bonaud <paul.bonaud@fretlink.com> | 2018-12-20 13:30:29 +0100 |
---|---|---|
committer | Paul Bonaud <paul.bonaud@fretlink.com> | 2020-01-08 15:09:12 +0100 |
commit | 4eb445023ef1506aac20afb44566160b306eb59b (patch) | |
tree | 986467ab88434e46ae350582988e17d7fa8c1034 /tasks | |
parent | feb48c4eb5dab5a61919226567e64ab748deec21 (diff) | |
download | ansible-rabbitmq-4eb445023ef1506aac20afb44566160b306eb59b.tar.gz ansible-rabbitmq-4eb445023ef1506aac20afb44566160b306eb59b.tar.zst ansible-rabbitmq-4eb445023ef1506aac20afb44566160b306eb59b.zip |
monkey_patch: ansible module 'rabbitmq_user' for rabbit v3.7.9
cf bug from https://github.com/rabbitmq/rabbitmq-cli/issues/264
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 | ||