nfsnfs::client: Manage the NFS clientnfs::client::config: Configure NFS as a client.nfs::client::package: Install needed packages for NFS clients.nfs::client::service: Manage the needed services for NFS clients.nfs::server: Manage the NFS server.nfs::server::config: Configure NFS as a server.nfs::server::package: Install needed packages for NFS server.nfs::server::service: Manage the needed services for NFS server.
nfs::client::mount: Manage all mounts on a NFS client.nfs::functions::bindmount: Manage bindmounts.nfs::functions::create_export: Manage export creation.nfs::functions::mkdir: Manage directory creation.nfs::functions::nfsv4_bindmount: Manage bindmounts for NFS v4.nfs::server::export: Manage all exported resources on a NFS server.
The nfs class.
- See also
The following parameters are available in the nfs class:
ensureserver_enabledclient_enabledstoreconfigs_enablednfs_v4nfs_v4_clientexports_fileidmapd_filedefaults_filemanage_packagesserver_packagesserver_package_ensureclient_packagesclient_package_ensuremanage_server_servicemanage_server_servicehelpermanage_client_serviceserver_service_nameserver_service_ensureserver_service_enableserver_service_hasrestartserver_service_hasstatusserver_service_restart_cmdserver_nfsv4_servicehelperclient_servicesclient_nfsv4_servicesclient_services_enableclient_idmapd_settingclient_nfs_fstypeclient_nfs_optionsclient_nfsv4_fstypeclient_nfsv4_optionsnfs_v4_export_rootnfs_v4_export_root_clientsnfs_v4_mount_rootnfs_v4_idmap_domainnfsv4_bindmount_enableclient_need_gssdclient_gssd_serviceclient_gssd_optionsclient_d9_gssdopt_workaroundnfs_v4_idmap_localrealmsnfs_v4_idmap_cachemanage_nfs_v4_idmap_nobody_mappingnfs_v4_idmap_nobody_usernfs_v4_idmap_nobody_groupclient_rpcbind_configclient_rpcbind_optnameclient_rpcbind_optsnfs_v4_root_export_ensurenfs_v4_root_export_mountnfs_v4_root_export_remountsnfs_v4_root_export_atbootnfs_v4_root_export_optionsnfs_v4_root_export_bindmountnfs_v4_root_export_tagclient_gssd_service_nameclient_services_hasrestartclient_services_hasstatusclient_gssdopt_name
Data type: Enum['present', 'absent', 'running', 'stopped', 'disabled']
Controls if the managed resources shall be present or absent.
If set to absent:
- The managed software packages are being uninstalled.
- Any traces of the packages will be purged as good as possible. This may include existing configuration files. The exact behavior is provider dependent.
- System modifications (if any) will be reverted as good as possible (e.g. removal of created users, services, changed log settings, ...).
- This is thus destructive and should be used with care.
Default value: 'present'
Data type: Boolean
If set to true, this module will configure the node to act as a NFS server.
Default value: false
Data type: Boolean
If set to true, this module will configure the node to act as a client server, you can use the exported mount
resources from configured servers.
Default value: false
Data type: Boolean
If set to false, this module will not export any resources as storeconfigs.
Default value: true
Data type: Boolean
If set to true, this module will use NFS version 4 for exporting and mounting NFS resources.
Default value: false
Data type: Boolean
If set to true, this module will use NFS version 4 for mounting NFS resources.
If set to false it will use NFS version 3 to mount NFS resources.
Default value: false
Data type: Stdlib::Absolutepath
It defines the location of file with the NFS export resources used by the NFS server.
Data type: Stdlib::Absolutepath
It defines the location of the file with the idmapd settings.
Data type: Optional[Stdlib::Absolutepath]
It defines the location of the file with the NFS settings.
Default value: undef
Data type: Boolean
It defines if the packages should be managed through this module.
Default value: true
Data type: Array
It defines the packages needed to be installed for acting as a NFS server.
Data type: String
It defines the packages state - any of present, installed, absent, purged, held, latest.
Default value: 'installed'
Data type: Array
It defines the packages needed to be installed for acting as a NFS client
Data type: String
It defines the packages state - any of present, installed, absent, purged, held, latest.
Default value: 'installed'
Data type: Boolean
Defines if module should manage server_service.
Default value: true
Data type: Boolean
Defines if module should manage server_servicehelper.
Default value: true
Data type: Boolean
Defines if module should manage client_service.
Default value: true
Data type: String
It defines the servicename of the NFS server service.
Data type: Enum['present', 'absent', 'running', 'stopped', 'disabled']
It defines the service parameter ensure for NFS server services.
Default value: 'running'
Data type: Boolean
It defines the service parameter enable for NFS server service.
Default value: true
Data type: Boolean
It defines the service parameter hasrestart for NFS server service.
Default value: true
Data type: Boolean
It defines the service parameter hasstatus for NFS server service.
Default value: true
Data type: Optional[String[1]]
It defines the service parameter restart for NFS server service.
Default value: undef
Data type: Optional[Array[String[1]]]
It defines the service helper like idmapd for servers configured with NFS version 4.
Default value: undef
Data type: Hash
It defines the servicenames need to be started when acting as a NFS client.
Data type: Hash
It defines the servicenames need to be started when acting as a NFS client version 4.
Data type: Boolean
It defines the service parameter enable for NFS client services.
Data type: Array[String]
It defines the Augeas parameter added in @param defaults_file when acting as a NFS version 4 client.
Default value: []
Data type: String[1]
It defines the name of the NFS filesystem, when adding entries to /etc/fstab on a client node.
Default value: 'nfs'
Data type: String
It defines the options for the NFS filesystem, when adding entries to /etc/fstab on a client node.
Data type: String
It defines the name of the NFS version 4 filesystem, when adding entries to /etc/fstab on a client node.
Data type: String
It defines the options for the NFS version 4 filesystem, when adding entries to /etc/fstab on a client node.
Data type: String
It defines the location where NFS version 4 exports should be bindmounted to on a server node.
Default value: '/export'
Data type: String
It defines the clients that are allowed to mount NFS version 4 exports and includes the option string.
Default value: "*.${facts['networking']['domain']}(ro,fsid=root,insecure,no_subtree_check,async,root_squash)"
Data type: String
It defines the location where NFS version 4 clients find the mount root on a server node.
Default value: '/srv'
Data type: String
It defines the name of the idmapd domain setting in @param idmapd_file needed to be set to the same value on a server and client node to do correct uid and gid mapping.
Default value: pick($facts['networking']['domain'], 'example.org')
Data type: Boolean
It defines if the module should create a bindmount for the export.
Default value: true
Data type: Boolean
If true, sets NEED_GSSD=yes in /etc/defauls/nfs-common, usable on Debian/Ubuntu.
Default value: false
Data type: Boolean
If true enable rpc-gssd service.
Default value: false
Data type: Optional[String[1]]
Options for rpc-gssd service.
Default value: undef
Data type: Boolean
If enabled, workaround for passing gssd_options which is broken on Debian 9. Usable only on Debian 9.
Default value: false
Data type: Variant[String, Array]
Local-Realms option for idmapd.
Default value: ''
Data type: Integer
Cache-Expiration option for idmapd. If 0 cache is unused.
Default value: 0
Data type: Boolean
Enable setting Nobody mapping in idmapd.
Default value: false
Data type: String
Nobody-User option for idmapd.
Data type: String
Nobody-Group option for idmapd.
Data type: Optional[Stdlib::Absolutepath]
It defines the location of the file with the rpcbind config.
Default value: undef
Data type: Optional[String]
It defines the name of environment variable that holds the rpcbind config. E.g. OPTIONS for Debian.
Default value: undef
Data type: Optional[String]
Options for rpcbind service.
Default value: undef
Data type: String
It defines the state of the NFS version 4 root export.
Default value: 'mounted'
Data type: Optional[String]
It defines the mountpoint of the NFS version 4 root export.
Default value: undef
Data type: Boolean
It defines if the NFS version 4 root export should be remounted.
Default value: false
Data type: Boolean
It defines if the NFS version 4 root export should be mounted at boot.
Default value: false
Data type: String
It defines the options for the NFS version 4 root export.
Default value: '_netdev'
Data type: Optional[String]
It defines the bindmount of the NFS version 4 root export.
Default value: undef
Data type: Optional[String]
It defines the tag of the NFS version 4 root export.
Default value: undef
Data type: Optional[Hash]
It defines the servicename of the rpc-gssd service.
Default value: undef
Data type: Boolean
It defines the service parameter hasrestart for NFS client services.
Default value: true
Data type: Boolean
It defines the service parameter hasstatus for NFS client services.
Default value: true
Data type: String
It defines the name of the gssd option in /etc/default/nfs-common.
This class exists to:
- Order the loading of classes,
- Including all needed classes for NFS as a client.
The following parameters are available in the nfs::client class:
Data type: String
The ensure parameter is used to determine if the NFS client should be configured and running or not.
Default value: $nfs::ensure
Data type: Boolean
The nfs_v4 parameter is used to determine if the NFS client should use NFS version 4.
Default value: $nfs::nfs_v4_client
Data type: String
The nfs_v4_mount_root parameter is used to determine the root directory for NFS version 4 mounts.
Default value: $nfs::nfs_v4_mount_root
Data type: String
The nfs_v4_idmap_domain parameter is used to determine the domain for NFS version 4 id mapping.
Default value: $nfs::nfs_v4_idmap_domain
Configure NFS as a client.
Install needed packages for NFS clients.
Manage the needed services for NFS clients.
This class exists to:
- Order the loading of classes,
- Including all needed classes for NFS as a server.
The following parameters are available in the nfs::server class:
ensurenfs_v4nfs_v4_export_rootnfs_v4_export_root_clientsnfs_v4_idmap_domainnfs_v4_root_export_ensurenfs_v4_root_export_mountnfs_v4_root_export_remountsnfs_v4_root_export_atbootnfs_v4_root_export_optionsnfs_v4_root_export_bindmountnfs_v4_root_export_tag
Data type: Enum['present', 'absent', 'running', 'stopped', 'disabled']
Default value: $nfs::ensure
Data type: Boolean
Default value: $nfs::nfs_v4
Data type: String
Default value: $nfs::nfs_v4_export_root
Data type: String
Default value: $nfs::nfs_v4_export_root_clients
Data type: String
Default value: $nfs::nfs_v4_idmap_domain
Data type: String
Default value: $nfs::nfs_v4_root_export_ensure
Data type: Optional[String]
Default value: $nfs::nfs_v4_root_export_mount
Data type: Boolean
Default value: $nfs::nfs_v4_root_export_remounts
Data type: Boolean
Default value: $nfs::nfs_v4_root_export_atboot
Data type: String
Default value: $nfs::nfs_v4_root_export_options
Data type: Optional[String]
Default value: $nfs::nfs_v4_root_export_bindmount
Data type: Optional[String]
Default value: $nfs::nfs_v4_root_export_tag
Configure NFS as a server.
Install needed packages for NFS server.
Manage the needed services for NFS server.
param nfs_v4 When set to true, it uses NFS version 4 to mount a share.
class { 'nfs':
client_enabled => true,
nfs_v4_client => true
}
nfs::client::mount { '/target/directory':
server => '1.2.3.4',
share => 'share_name_on_nfs_server',
remounts => true,
atboot => true,
options_nfsv4 => 'tcp,nolock,rsize=32768,wsize=32768,intr,noatime,actimeo=3'
}The following parameters are available in the nfs::client::mount defined type:
servershareensureremountsatbootoptions_nfsv4options_nfsbindmountnfstagownergroupmodemount_rootmountmanage_packagesclient_packagesnfs_v4
Data type: String[1]
Sets the ip address of the server with the NFS export.
Data type: Optional[String[1]]
Sets the name of the NFS share on the server.
Default value: undef
Data type: String[1]
Sets the ensure parameter of the mount.
Default value: 'mounted'
Data type: Boolean
Sets the remounts parameter of the mount.
Default value: false
Data type: Boolean
Sets the atboot parameter of the mount.
Default value: false
Data type: String[1]
Sets the mount options for a NFS version 4 mount.
Default value: $nfs::client_nfsv4_options
Data type: String[1]
Sets the mount options for a NFS mount.
Default value: $nfs::client_nfs_options
Data type: Optional[String[1]]
When not undef it will create a bindmount on the node for the NFS mount.
Default value: undef
Data type: Optional[String[1]]
Sets the nfstag parameter of the mount.
Default value: undef
Data type: Optional[String[1]]
Set owner of mount directory.
Default value: undef
Data type: Optional[String[1]]
Set group of mount directory.
Default value: undef
Data type: Optional[String[1]]
Set mode of mount directory.
Default value: undef
Data type: Optional[String[1]]
Overwrite mount root if differs from server configuration.
Default value: undef
Data type: String[1]
Default value: $title
Data type: Boolean
Default value: $nfs::manage_packages
Data type: Optional[Variant[String[1], Array[String[1]]]]
Default value: $nfs::effective_client_packages
Data type: Boolean
Default value: $nfs::client::nfs_v4
Manage bindmounts.
The following parameters are available in the nfs::functions::bindmount defined type:
Data type: Optional[String[1]]
Sets the target directory for the bindmount.
Default value: undef
Data type: String[1]
Sets if enabled or not.
Default value: 'present'
Manage export creation.
The following parameters are available in the nfs::functions::create_export defined type:
Data type: Variant[String[1], Array[String[1]]]
Sets the clients allowed to mount the export with options.
Data type: String[1]
Sets if enabled or not.
Default value: 'present'
Data type: Optional[String[1]]
Sets the owner of the exported directory.
Default value: undef
Data type: Optional[String[1]]
Sets the group of the exported directory.
Default value: undef
Data type: Optional[String[1]]
Sets the permissions of the exported directory.
Default value: undef
Data type: Boolean
Whether or not to manage the directory to be exported.
Default value: true
Manage directory creation.
The following parameters are available in the nfs::functions::mkdir defined type:
Data type: String[1]
Default value: 'present'
Manage bindmounts for NFS v4.
The following parameters are available in the nfs::functions::nfsv4_bindmount defined type:
Data type: String[1]
Sets the target directory for the bindmount.
Data type: String[1]
Sets the bindmount options.
Data type: String[1]
Sets if mounted or not.
Default value: 'mounted'
Manage all exported resources on a NFS server.
class { 'nfs':
server_enabled => true,
nfs_v4 => true,
nfs_v4_export_root => '/share',
nfs_v4_export_root_clients => '1.2.3.4/24(rw,fsid=root,insecure,no_subtree_check,async,no_root_squash)',
}
nfs::server::export { '/srv/nfs_exported/directory':
clients => '1.2.3.4/24(rw,insecure,no_subtree_check,async,no_root_squash) 5.6.7.8/24(ro)',
share => 'share_name_on_nfs_server',
}The following parameters are available in the nfs::server::export defined type:
clientsbindensureremountsatbootoptions_nfsv4options_nfsbindmountnfstagmountownergroupmodeserverv3_export_namev4_export_namenfsv4_bindmount_enablemanage_directory
Data type: Variant[String[1],Array[String[1]]]
Sets the allowed clients and options for the export in the exports file.
Default value: 'localhost(ro)'
Data type: String[1]
Sets the bind options setted in /etc/fstab for the bindmounts created.
Default value: 'rbind'
Data type: String[1]
If enabled the mount will be created.
Default value: 'mounted'
Data type: Boolean
Sets the remounts parameter of the mount.
Default value: false
Data type: Boolean
Sets the atboot parameter of the mount.
Default value: false
Data type: String[1]
Sets the mount options for a NFS version 4 exported resource mount.
Default value: $nfs::client_nfsv4_options
Data type: String[1]
Sets the mount options for a NFS exported resource mount.
Default value: $nfs::client_nfs_options
Data type: Optional[String[1]]
When not undef it will create a bindmount on the node for the NFS mount.
Default value: undef
Data type: Optional[String[1]]
Sets the nfstag parameter of the mount.
Default value: undef
Data type: Optional[String[1]]
Sets the mountpoint the client will mount the exported resource mount on. If undef it defaults to the same path as on the server.
Default value: undef
Data type: Optional[String[1]]
Sets the owner of the exported directory.
Default value: undef
Data type: Optional[String[1]]
Sets the group of the exported directory.
Default value: undef
Data type: Optional[String[1]]
Sets the permissions of the exported directory.
Default value: undef
Data type: String[1]
Sets the hostname clients will use to mount the exported resource. If undef it defaults to the trusted certname.
Default value: $facts['clientcert']
Data type: String[1]
Default value: $name
Data type: String[1]
Default value: regsubst($name, '.*/(.*)', '\1' )
Data type: Boolean
Default value: $nfs::nfsv4_bindmount_enable
Data type: Boolean
Whether or not to manage the directory to be exported.
Default value: true