2016-05-06 02:20:03 +08:00
|
|
|
---
|
2016-07-21 21:17:19 +08:00
|
|
|
- name: create nfs gateway directories
|
2016-05-06 02:20:03 +08:00
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: "{{ dir_owner }}"
|
|
|
|
group: "{{ dir_group }}"
|
|
|
|
mode: "{{ dir_mode }}"
|
|
|
|
with_items:
|
|
|
|
- /var/lib/nfs/ganesha
|
|
|
|
- /var/run/ganesha
|
|
|
|
|
2016-07-21 21:17:19 +08:00
|
|
|
- name: create rgw nfs user
|
|
|
|
command: radosgw-admin user create --uid={{ ceph_nfs_rgw_user }} --display-name="RGW NFS User"
|
|
|
|
register: rgwuser
|
2016-08-18 20:24:48 +08:00
|
|
|
when: nfs_obj_gw
|
2016-07-21 21:17:19 +08:00
|
|
|
|
|
|
|
- name: set access key
|
|
|
|
set_fact:
|
|
|
|
ceph_nfs_rgw_access_key: "{{ (rgwuser.stdout | from_json)['keys'][0]['access_key'] }}"
|
2016-08-18 20:24:48 +08:00
|
|
|
when: nfs_obj_gw
|
2016-07-21 21:17:19 +08:00
|
|
|
|
|
|
|
- name: set secret key
|
|
|
|
set_fact:
|
|
|
|
ceph_nfs_rgw_secret_key: "{{(rgwuser.stdout | from_json)['keys'][0]['secret_key']}}"
|
2016-08-18 20:24:48 +08:00
|
|
|
when: nfs_obj_gw
|
2016-07-21 21:17:19 +08:00
|
|
|
|
|
|
|
- name: generate ganesha configuration file
|
|
|
|
action: config_template
|
|
|
|
args:
|
|
|
|
src: "{{ playbook_dir }}/roles/ceph-common/templates/ganesha.conf.j2"
|
|
|
|
dest: /etc/ganesha/ganesha.conf
|
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
|
|
|
mode: "0644"
|
|
|
|
config_overrides: "{{ ganesha_conf_overrides }}"
|
|
|
|
config_type: ini
|
|
|
|
|
|
|
|
- name: start nfs gateway service
|
2016-05-06 02:20:03 +08:00
|
|
|
service:
|
|
|
|
name: nfs-ganesha
|
|
|
|
state: started
|
|
|
|
enabled: yes
|