2018-11-30 03:04:04 +08:00
|
|
|
# This example playbook is used to add rgw users and buckets
|
|
|
|
#
|
|
|
|
# This example is run on your local machine
|
|
|
|
#
|
2021-08-06 18:40:19 +08:00
|
|
|
# Ensure that your local machine can connect to rgw of your cluster
|
2018-11-30 03:04:04 +08:00
|
|
|
#
|
|
|
|
# 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
|
2024-02-14 18:14:02 +08:00
|
|
|
# users and buckets you want
|
2018-11-30 03:04:04 +08:00
|
|
|
#
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Add rgw users and buckets
|
2018-11-30 03:04:04 +08:00
|
|
|
connection: local
|
|
|
|
hosts: localhost
|
2024-02-14 18:14:02 +08:00
|
|
|
gather_facts: false
|
2018-11-30 03:04:04 +08:00
|
|
|
tasks:
|
2024-02-14 18:14:02 +08:00
|
|
|
- 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'
|