nfs
nfs::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::params
: Manages defaults values for this module.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:
ensure
server_enabled
client_enabled
storeconfigs_enabled
nfs_v4
nfs_v4_client
exports_file
idmapd_file
defaults_file
manage_packages
server_packages
server_package_ensure
client_packages
client_package_ensure
manage_server_service
manage_server_servicehelper
manage_client_service
server_service_name
server_service_ensure
server_service_enable
server_service_hasrestart
server_service_hasstatus
server_service_restart_cmd
server_nfsv4_servicehelper
client_services
client_nfsv4_services
client_services_enable
client_idmapd_setting
client_nfs_fstype
client_nfs_options
client_nfsv4_fstype
client_nfsv4_options
nfs_v4_export_root
nfs_v4_export_root_clients
nfs_v4_mount_root
nfs_v4_idmap_domain
nfsv4_bindmount_enable
client_need_gssd
client_gssd_service
client_gssd_options
client_d9_gssdopt_workaround
nfs_v4_idmap_localrealms
nfs_v4_idmap_cache
manage_nfs_v4_idmap_nobody_mapping
nfs_v4_idmap_nobody_user
nfs_v4_idmap_nobody_group
client_rpcbind_config
client_rpcbind_optname
client_rpcbind_opts
nfs_v4_root_export_ensure
nfs_v4_root_export_mount
nfs_v4_root_export_remounts
nfs_v4_root_export_atboot
nfs_v4_root_export_options
nfs_v4_root_export_bindmount
nfs_v4_root_export_tag
client_gssd_service_name
client_services_hasrestart
client_services_hasstatus
client_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.
Default value: $nfs::params::exports_file
Data type: Stdlib::Absolutepath
It defines the location of the file with the idmapd settings.
Default value: $nfs::params::idmapd_file
Data type: Optional[Stdlib::Absolutepath]
It defines the location of the file with the NFS settings.
Default value: $nfs::params::defaults_file
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.
Default value: $nfs::params::server_packages
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
Default value: $nfs::params::client_packages
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.
Default value: $nfs::params::server_service_name
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: $nfs::params::server_service_hasrestart
Data type: Boolean
It defines the service parameter hasstatus for NFS server service.
Default value: $nfs::params::server_service_hasstatus
Data type: Optional[String]
It defines the service parameter restart for NFS server service.
Default value: $nfs::params::server_service_restart_cmd
Data type: Optional[Array]
It defines the service helper like idmapd for servers configured with NFS version 4.
Default value: $nfs::params::server_nfsv4_servicehelper
Data type: Hash
It defines the servicenames need to be started when acting as a NFS client.
Default value: $nfs::params::client_services
Data type: Hash
It defines the servicenames need to be started when acting as a NFS client version 4.
Default value: $nfs::params::client_nfsv4_services
Data type: Boolean
It defines the service parameter enable for NFS client services.
Default value: $nfs::params::client_services_enable
Data type: Array[String]
It defines the Augeas parameter added in @param defaults_file when acting as a NFS version 4 client.
Default value: $nfs::params::client_idmapd_setting
Data type: String
It defines the name of the NFS filesystem, when adding entries to /etc/fstab
on a client node.
Default value: $nfs::params::client_nfs_fstype
Data type: String
It defines the options for the NFS filesystem, when adding entries to /etc/fstab
on a client node.
Default value: $nfs::params::client_nfs_options
Data type: String
It defines the name of the NFS version 4 filesystem, when adding entries to /etc/fstab
on a client node.
Default value: $nfs::params::client_nfsv4_fstype
Data type: String
It defines the options for the NFS version 4 filesystem, when adding entries to /etc/fstab
on a client node.
Default value: $nfs::params::client_nfsv4_options
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: $nfs::params::nfs_v4_idmap_domain
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: String
Options for rpc-gssd service.
Default value: $nfs::params::client_gssd_options
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.
Default value: $nfs::params::nfs_v4_idmap_nobody_user
Data type: String
Nobody-Group
option for idmapd.
Default value: $nfs::params::nfs_v4_idmap_nobody_group
Data type: Optional[Stdlib::Absolutepath]
It defines the location of the file with the rpcbind config.
Default value: $nfs::params::client_rpcbind_config
Data type: Optional[String]
It defines the name of environment variable that holds the rpcbind config. E.g. OPTIONS for Debian.
Default value: $nfs::params::client_rpcbind_optname
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: $nfs::params::client_gssd_service_name
Data type: Boolean
It defines the service parameter hasrestart for NFS client services.
Default value: $nfs::params::client_services_hasrestart
Data type: Boolean
It defines the service parameter hasstatus for NFS client services.
Default value: $nfs::params::client_services_hasstatus
Data type: String
It defines the name of the gssd option in /etc/default/nfs-common
.
Default value: $nfs::params::client_gssdopt_name
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
- Declutter the default value assignment for class parameters,
- Manage internally used module variables in a central place.
Therefore, many operating system dependent differences (names, paths, ...) are addressed in here.
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:
ensure
nfs_v4
nfs_v4_export_root
nfs_v4_export_root_clients
nfs_v4_idmap_domain
nfs_v4_root_export_ensure
nfs_v4_root_export_mount
nfs_v4_root_export_remounts
nfs_v4_root_export_atboot
nfs_v4_root_export_options
nfs_v4_root_export_bindmount
nfs_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:
server
share
ensure
remounts
atboot
options_nfsv4
options_nfs
bindmount
nfstag
owner
group
mode
mount_root
mount
manage_packages
client_packages
nfs_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
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:
clients
bind
ensure
remounts
atboot
options_nfsv4
options_nfs
bindmount
nfstag
mount
owner
group
mode
server
v3_export_name
v4_export_name
nfsv4_bindmount_enable
Data type: 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