From e8b81300716c0fc9d1f5d29f7ed7a7b72fbf4265 Mon Sep 17 00:00:00 2001 From: Paul Bonaud Date: Mon, 17 Dec 2018 19:06:16 +0100 Subject: fix: don't fail on user creation if tags is missing --- tasks/rabbitmq_users.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/rabbitmq_users.yml b/tasks/rabbitmq_users.yml index 98e45e2..f1d6e8c 100644 --- a/tasks/rabbitmq_users.yml +++ b/tasks/rabbitmq_users.yml @@ -7,7 +7,7 @@ configure_priv: "{{ item['configure_priv'] }}" read_priv: "{{ item['read_priv'] }}" write_priv: "{{ item['write_priv'] }}" - tags: "{{ item['tags'] }}" + tags: "{{ item['tags']|default(omit) }}" state: present become: true with_items: "{{ rabbitmq_users }}" @@ -24,7 +24,7 @@ configure_priv: "{{ item['configure_priv'] }}" read_priv: "{{ item['read_priv'] }}" write_priv: "{{ item['write_priv'] }}" - tags: "{{ item['tags'] }}" + tags: "{{ item['tags']|default(omit) }}" state: present run_once: yes become: true -- cgit v1.2.3 From 1c913a96ca3a2983e2e2b2edfed8fa55a1e954f3 Mon Sep 17 00:00:00 2001 From: Paul Bonaud Date: Thu, 20 Dec 2018 09:16:07 +0100 Subject: rabbitmq_users: Allow permissions on multiple vhosts --- tasks/rabbitmq_users.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tasks/rabbitmq_users.yml b/tasks/rabbitmq_users.yml index f1d6e8c..82aa734 100644 --- a/tasks/rabbitmq_users.yml +++ b/tasks/rabbitmq_users.yml @@ -3,11 +3,12 @@ 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'] }}" + vhost: "{{ item['vhost']|default(omit) }}" + configure_priv: "{{ item['configure_priv']|default(omit) }}" + read_priv: "{{ item['read_priv']|default(omit) }}" + write_priv: "{{ item['write_priv']|default(omit) }}" tags: "{{ item['tags']|default(omit) }}" + permissions: "{{ item['permissions']|default(omit) }}" state: present become: true with_items: "{{ rabbitmq_users }}" @@ -20,11 +21,12 @@ 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'] }}" + vhost: "{{ item['vhost']|default(omit) }}" + configure_priv: "{{ item['configure_priv']|default(omit) }}" + read_priv: "{{ item['read_priv']|default(omit) }}" + write_priv: "{{ item['write_priv']|default(omit) }}" tags: "{{ item['tags']|default(omit) }}" + permissions: "{{ item['permissions']|default(omit) }}" state: present run_once: yes become: true -- cgit v1.2.3