2017-09-19 22:19:14 +08:00
|
|
|
---
|
2017-09-27 05:16:43 +08:00
|
|
|
- name: create /etc/ganesha
|
|
|
|
file:
|
|
|
|
path: /etc/ganesha
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "0755"
|
|
|
|
|
2017-09-19 22:19:14 +08:00
|
|
|
- name: generate ganesha configuration file
|
|
|
|
action: config_template
|
|
|
|
args:
|
|
|
|
src: "{{ lookup('env', 'ANSIBLE_ROLES_PATH') | default (playbook_dir + '/roles', true) }}/ceph-nfs/templates/ganesha.conf.j2"
|
|
|
|
dest: /etc/ganesha/ganesha.conf
|
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
|
|
|
mode: "0644"
|
|
|
|
config_type: ini
|
|
|
|
notify:
|
|
|
|
- restart ceph nfss
|
|
|
|
|
2017-10-04 19:25:53 +08:00
|
|
|
- name: create exports directory
|
|
|
|
file:
|
|
|
|
path: /etc/ganesha/export.d
|
|
|
|
state: directory
|
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
|
|
|
mode: "0755"
|
2017-10-16 20:15:43 +08:00
|
|
|
when:
|
|
|
|
- ceph_nfs_dynamic_exports
|
2017-10-04 19:25:53 +08:00
|
|
|
|
|
|
|
- name: create exports dir index file
|
|
|
|
copy:
|
|
|
|
content: ""
|
|
|
|
force: no
|
|
|
|
dest: /etc/ganesha/export.d/INDEX.conf
|
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
|
|
|
mode: "0644"
|
2017-10-16 20:15:43 +08:00
|
|
|
when:
|
|
|
|
- ceph_nfs_dynamic_exports
|
2017-10-04 19:25:53 +08:00
|
|
|
|
2017-09-27 05:16:43 +08:00
|
|
|
- name: generate systemd unit file
|
|
|
|
become: true
|
|
|
|
template:
|
|
|
|
src: "{{ role_path }}/templates/ceph-nfs.service.j2"
|
|
|
|
dest: /etc/systemd/system/ceph-nfs@.service
|
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
|
|
|
mode: "0644"
|
|
|
|
when:
|
|
|
|
- containerized_deployment
|
|
|
|
|
|
|
|
- name: systemd start nfs container
|
|
|
|
systemd:
|
2017-10-04 19:09:43 +08:00
|
|
|
name: ceph-nfs@{{ ceph_nfs_service_suffix | default(ansible_hostname) }}
|
2017-09-27 05:16:43 +08:00
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
daemon_reload: yes
|
|
|
|
when:
|
|
|
|
- containerized_deployment
|
2017-10-16 20:15:43 +08:00
|
|
|
- ceph_nfs_enable_service
|
2017-09-27 05:16:43 +08:00
|
|
|
|
2017-09-19 22:19:14 +08:00
|
|
|
- name: start nfs gateway service
|
2017-10-16 20:15:43 +08:00
|
|
|
systemd:
|
2017-09-19 22:19:14 +08:00
|
|
|
name: nfs-ganesha
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
when:
|
2017-09-27 05:16:43 +08:00
|
|
|
- not containerized_deployment
|
2017-10-16 20:15:43 +08:00
|
|
|
- ceph_nfs_enable_service
|