]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Example ceph_add_users_buckets playbook
authorDaniel-Pivonka <dpivonka@redhat.com>
Thu, 29 Nov 2018 19:04:04 +0000 (14:04 -0500)
committerSébastien Han <seb@redhat.com>
Thu, 20 Dec 2018 13:23:25 +0000 (14:23 +0100)
This is example playbook will show how to bulk add rgw users and buckets

Signed-off-by: Daniel-Pivonka <dpivonka@redhat.com>
infrastructure-playbooks/rgw-add-users-buckets.yml [new file with mode: 0644]

diff --git a/infrastructure-playbooks/rgw-add-users-buckets.yml b/infrastructure-playbooks/rgw-add-users-buckets.yml
new file mode 100644 (file)
index 0000000..79319ab
--- /dev/null
@@ -0,0 +1,65 @@
+# This example playbook is used to add rgw users and buckets
+#
+# This example is run on your local machine
+#
+# Ensure that your local machine cant connect to rgw of your cluster
+#
+# You will need to update the following vars
+#
+# rgw_host
+# port
+# admin_access_key
+# admin_secret_key
+#
+# Additionally modify the users list and buckets list to create the
+# users and buckets you want 
+#
+- name: add rgw users and buckets
+  connection: local
+  hosts: localhost
+  gather_facts: no
+  tasks:
+  - name: add rgw users and buckets
+    ceph_add_users_buckets:
+      rgw_host: '172.20.0.2'
+      port: 8000
+      admin_access_key: '8W56BITCSX27CD555Z5B'
+      admin_secret_key: 'JcrsUNDNPAvnAWHiBmwKOzMNreOIw2kJWAclQQ20'
+      users:
+        - username: 'test1'
+          fullname: 'tester'
+          email: 'dan1@email.com'
+          maxbucket: 666
+          suspend: false
+          autogenkey: false
+          accesskey: 'B3AR4Q33L59YV56A9A2F'
+          secretkey: 'd84BRnMysnVGSyZiRlYUMduVgIarQWiNMdKzrF76'
+          userquota: true
+          usermaxsize: '1000'
+          usermaxobjects: 3
+          bucketquota: true
+          bucketmaxsize: '1000'
+          bucketmaxobjects: 3
+        - username: 'test2'
+          fullname: 'tester'
+      buckets:
+        - bucket: 'bucket1'
+          user: 'test2'
+        - bucket: 'bucket2'
+          user: 'test1'
+        - bucket: 'bucket3'
+          user: 'test1'
+        - bucket: 'bucket4'
+          user: 'test1'
+        - bucket: 'bucket5'
+          user: 'test1'
+        - bucket: 'bucket6'
+          user: 'test2'
+        - bucket: 'bucket7'
+          user: 'test2'
+        - bucket: 'bucket8'
+          user: 'test2'
+        - bucket: 'bucket9'
+          user: 'test2'
+        - bucket: 'bucket10'
+          user: 'test2'