HanXHX.nfs
NFS Ansible Role
This role installs and sets up NFS (Network File System) client/server on Debian. It also manages the cache for the NFS client. It supports Debian versions Jessie and Stretch, and it should work on other Debian-based systems (like Ubuntu).
Requirements
No special requirements.
Role Variables
Role Configuration
Set nfs_server
or nfs_client
to true to enable them.
Client
nfs_use_client_cache
: Set to true to enable file caching.nfs_cache_path
: Path to the cache directory.nfs_mounts
: List of settings, including:localpath
: (Required) Local directory to mount the NFS share.remotepath
: (Required) Remote directory on the NFS server.remotehost
: (Required) IP address of the NFS server.enabled
: (Optional) True to enable this mount, or false to disable it.item.deleted
: (Optional) True to delete the share.
Server
nfs_exports
: List of settings for shared directories, including:path
: (Required) Directory to share.options
: (Required) NFS options (check the manual with "man exports").owner
: (Optional) Owner of the directory.group
: (Optional) Group of the directory.mode
: (Optional) Permissions for the directory.
Dependencies
No dependencies.
Example Playbook
Here’s how to use this role with some example settings:
- hosts: servers
roles:
- { role: HanXHX.nfs, nfs_server: true }
- hosts: client
roles:
- { role: HanXHX.nfs, nfs_client: true }
License
This role is licensed under GPL v2.
Donation
If you found this code helpful or used it in your projects, feel free to buy me a drink! :beers:
- Bitcoin:
1BQwhBeszzWbUTyK4aUyq3SRg7rBSHcEQn
- Ethereum:
0x63abe6b2648fd892816d87a31e3d9d4365a737b5
- Litecoin:
LeNDw34zQLX84VvhCGADNvHMEgb5QyFXyD
- Monero:
45wbf7VdQAZS5EWUrPhen7Wo4hy7Pa7c7ZBdaWQSRowtd3CZ5vpVw5nTPphTuqVQrnYZC72FXDYyfP31uJmfSQ6qRXFy3bQ
No cryptocurrency? You can also support the project by giving it a star! :star:
Author Information
- Twitter: @hanxhx_