ceph-ansible/roles/ceph-nfs/tasks/pre_requisite.yml

44 lines
1.1 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

---
- name: create nfs gateway directories
file:
path: "{{ item }}"
state: directory
owner: "ceph"
group: "ceph"
mode: "0755"
with_items:
- /var/lib/nfs/ganesha
- /var/run/ganesha
- name: create rgw nfs user
command: radosgw-admin --cluster {{ cluster }} user create --uid={{ ceph_nfs_rgw_user }} --display-name="RGW NFS User"
register: rgwuser
when: nfs_obj_gw
- name: set access key
set_fact:
ceph_nfs_rgw_access_key: "{{ (rgwuser.stdout | from_json)['keys'][0]['access_key'] }}"
when: nfs_obj_gw
- name: set secret key
set_fact:
ceph_nfs_rgw_secret_key: "{{(rgwuser.stdout | from_json)['keys'][0]['secret_key']}}"
when: nfs_obj_gw
- name: generate ganesha configuration file
action: config_template
args:
src: "{{ lookup('env', 'ANSIBLE_ROLES_PATH') | default (playbook_dir + '/roles', true) }}/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
service:
name: nfs-ganesha
state: started
enabled: yes