2017-09-19 22:19:14 +08:00
|
|
|
|
---
|
|
|
|
|
- name: set_fact docker_exec_cmd_nfs
|
|
|
|
|
set_fact:
|
|
|
|
|
docker_exec_cmd_nfs: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
|
|
|
|
|
when:
|
|
|
|
|
- containerized_deployment
|
|
|
|
|
|
|
|
|
|
- name: create rgw nfs user
|
2017-09-22 21:37:43 +08:00
|
|
|
|
command: "{{ docker_exec_cmd_nfs | default([]) }} radosgw-admin --cluster {{ cluster }} user create --uid={{ ceph_nfs_rgw_user }} --display-name='RGW NFS User'"
|
2017-09-19 22:19:14 +08:00
|
|
|
|
register: rgwuser
|
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
|
when:
|
|
|
|
|
- nfs_obj_gw
|
|
|
|
|
|
|
|
|
|
- name: set_fact ceph_nfs_rgw_access_key
|
|
|
|
|
set_fact:
|
|
|
|
|
ceph_nfs_rgw_access_key: "{{ (rgwuser.stdout | from_json)['keys'][0]['access_key'] }}"
|
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
|
when:
|
|
|
|
|
- nfs_obj_gw
|
|
|
|
|
- ceph_nfs_rgw_access_key is not defined
|
|
|
|
|
|
|
|
|
|
- name: set_fact ceph_nfs_rgw_secret_key
|
|
|
|
|
set_fact:
|
|
|
|
|
ceph_nfs_rgw_secret_key: "{{(rgwuser.stdout | from_json)['keys'][0]['secret_key']}}"
|
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
|
when:
|
|
|
|
|
- nfs_obj_gw
|
|
|
|
|
- ceph_nfs_rgw_secret_key is not defined
|