]> git.immae.eu Git - github/fretlink/ansible-rabbitmq.git/commitdiff
rabbitmq_users: Allow permissions on multiple vhosts
authorPaul Bonaud <paul.bonaud@fretlink.com>
Thu, 20 Dec 2018 08:16:07 +0000 (09:16 +0100)
committerPaul Bonaud <paul.bonaud@fretlink.com>
Thu, 20 Dec 2018 10:23:18 +0000 (11:23 +0100)
tasks/rabbitmq_users.yml

index f1d6e8cdca16a4ca2aca55ad36eea30295bc6ced..82aa73416931591e2f620750b7bbc0953fae8b07 100644 (file)
@@ -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 }}"
   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