-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSuperPiServerNFS.yml
More file actions
55 lines (55 loc) · 1.46 KB
/
SuperPiServerNFS.yml
File metadata and controls
55 lines (55 loc) · 1.46 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
- hosts: superpimaster
remote_user: pi
become: yes
tasks:
- name: Install nfs kernel packages
apt:
pkg:
- nfs-kernel-server
- nfs-common
- rpcbind
- name: Create usb1 mountpoint
file:
path: /mnt/usb1
state: directory
mode: '0755'
owner: pi
group: pi
- name: Create /mnt/usb2 mountpoint
file:
path: /mnt/usb2
state: directory
owner: pi
group: pi
- name: Create /etc/exports
file:
path: /etc/exports
state: touch
owner: root
group: root
mode: '0755'
- name: Add export entry to /etc/exports
blockinfile:
path: /etc/exports
block: |
/mnt/usb1 192.168.1.0/24(rw,all_squash,insecure,async,no_subtree_check,anonuid=1000,anongid=1000)
/mnt/usb2 192.168.1.0/24(rw,all_squash,insecure,async,no_subtree_check,anonuid=1000,anongid=1000)
- name: Set up fstab
blockinfile:
path: /etc/fstab
block: |
UUID=4A82082582081859 /mnt/usb1 ntfs defaults,nofail 0 0
UUID=963E77F33E77CB2F /mnt/usb2 ntfs defaults,nofail 0 0
- name: Start nfs-kernel-server
systemd:
name: nfs-kernel-server
state: enabled
- name: Start nfs-common
systemd:
name: nfs-common
state: enabled
masked: no
- name: Start rpcbind
systemd:
name: rpcbind
state: enabled