Install and configure an NFS server and shares. For more information on Droid, please see droidphp.com.
The steps involved are:-
- Install the nfs-server package.
- Create directories to be shared.
- Write configuration files.
- Stop and then start the NFS Kernel and NFS Common services.
- The platform is Debian-based.
- An NFS server is not already installed and exporting shares - any existing configuration is overwritten.
- Requires portmapper and rpcbind for client discoverability.
- Any host configured to statically assign a port number to the lockd daemon (see Optional Information, below) will require a reboot.
Configuration files managed by the module will be overwritten each time the module is run.
-
The following existing configuration files are overwritten:-
- /etc/hosts.allow
- /etc/hosts.deny
-
The following configuration files are installed by their respective platform packages during the execution of the module and then overwritten:-
- /etc/exports
- /etc/default/nfs-common
- /etc/default/nfs-kernel-server
-
The following new configuration files are written:-
- /etc/modprobe.d/lockd.conf
-
A list of exports, as follows:-
module_nfs_server: exports: - path: <string> # The path to be exported common_opts: <string> # Export options common to all clients clients: # List of clients - name: <string> # hostname or IP address of a permitted client opts: <string> # Optional client-specific export options
-
A list of directories to be shared (exported):-
module_nfs_server_shares: - path: <string> # path to a directory to create and export mode: <string || number> # file mode of the directory
-
Per-host entries in hosts.allow and hosts.deny to secure access to NFS related daemons by way of tcpwrappers:-
hosts: nfs_server: variables: hosts_deny: - <string> # suggest: "lockd: ALL" # "mountd: ALL" # "rpcbind: ALL" # "rquotad: ALL" # "statd: ALL" hosts_allow: - <string> # suggest: "lockd: 10.0.1.80 10.0.1.81" # "mountd: 10.0.1.80 10.0.1.81" # "rpcbind: 10.0.1.80 10.0.1.81" # "rquotad: 10.0.1.80 10.0.1.81" # "statd: 10.0.1.80 10.0.1.81"
-
Per-host default options in /etc/default/nfs-common and nfs-kernel-server to statically assign port numbers to the statd and mountd daemons:-
hosts: nfs_server: variables: statd_opts: port: <integer> outgoing_port: <integer> mountd_opts: port: <integer>
-
Per-host kernel options to statically assign TCP and UDP ports to the lockd daemon:-
hosts: nfs_server: variables: lockd_opts: port: <integer>