Role: nfs¶
NFS server configuration on proxfold and NFS client mount on arrstack. The same role handles both modes via variables.
Hosts: proxfold (server), arrstack (client)
Tasks¶
Server tasks (when nfs_server: true)¶
| Task | Tag |
|---|---|
Install nfs-kernel-server |
nfs, server |
Deploy /etc/exports from template |
nfs, server |
| Enable and start NFS service | nfs, server |
Client tasks (when nfs_client: true)¶
| Task | Tag |
|---|---|
Install nfs-common |
nfs, client |
| Create mount point directories | nfs, client |
Configure fstab entries via ansible.posix.mount |
nfs, client |
Key variables¶
proxfold (server)¶
nfs_server: true
nfs_exports:
- path: /stash
options: "192.168.1.252(rw,sync,no_subtree_check,no_root_squash)"
arrstack (client)¶
nfs_client: true
nfs_mounts:
- src: "192.168.1.250:/stash"
path: /stash
fstype: nfs
opts: "defaults,_netdev"
Mount options:
- defaults — Standard mount options (rw, suid, dev, exec, auto, nouser, async)
- _netdev — Wait for network before mounting (prevents boot hang if NFS server is unreachable)
Templates¶
exports.j2— Renders/etc/exportsfrom thenfs_exportslist
Related¶
- Storage — NFS export details and the expected exports config