blob: 7be5f2a290ccb17f6e22057bbbf282a3041efe57 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
- name: create nfsd data directory
file:
path: "{{ nfsd_data_dir }}"
owner: 0
group: 0
mode: 0700
state: directory
- name: create hosts directories
file:
path: "{{ nfsd_data_dir }}/{{ item }}"
owner: 0
group: 0
mode: 0777
state: directory
loop: "{{ nfsd_shared_dirs }}"
- name: generate nfsd configuration
template:
src: exports.j2
dest: /etc/exports
owner: root
mode: 0640
register: result
- name: enable and start nfsd service
service: &nfsd_service
name: nfsd
state: "{{ 'restarted' if result.changed else 'started' }}"
enabled: true
- name: enable and restart mountd
service:
<<: *nfsd_service
name: mountd
|