Puppet module to manage NFS client and server
This module has been tested to work on the following systems with Puppet
v4, v5 and v6 using the ruby versions that are shipped with each. See
.travis.yml
for the exact matrix.
If using Suse, there is a known issue regarding reverse path filtering which can be solved through kernel tuning.
http://www.novell.com/support/kb/doc.php?id=7007649
===
Boolean to use hiera_hash which merges all found instances of nfs::mounts in Hiera. This is useful for specifying mounts at different levels of the hierarchy and having them all included in the catalog.
Name of the NFS package. May be a string or an array.
Name of the NFS service
Hash of mounts to be mounted on system. See below.
Boolean to specify if the system is an NFS server.
The location of the config file.
The owner of the config file.
The group for the config file.
The mode for the config file.
===
nfs::idmap
String of the idmap package name.
The location of the config file.
The owner of the config file.
The group for the config file.
The mode for the config file.
String of the service name.
Boolean value of ensure parameter for idmapd service. Default is based on the platform. If running EL7 as an nfs-server, this must be set to 'running'.
Boolean value of enable parameter for idmapd service.
Boolean value of hasstatus parameter for idmapd service.
Boolean value of hasrestart parameter for idmapd service.
String value of domain to be set as local NFS domain.
$::domain
String value of ldap server name.
String value of ldap search base.
String or array of local kerberos realm names.
$::domain
String or array of mapping method to be used between NFS and local IDs. Valid values is nsswitch, umich_ldap or static.
String of local user name to be used when a mapping cannot be completed.
String of local group name to be used when a mapping cannot be completed.
Integer of verbosity level.
String of the directory for rpc_pipefs.
===
This works by iterating through the nfs::mounts hash and calling the types::mount resource. Thus, you can provide any valid parameter for mount. See the Type Reference for a complete list.
Mount nfs.example.com:/vol1 on /mnt/vol1 and nfs.example.com:/vol2 on /mnt/vol2
nfs::mounts:
/mnt/vol1:
device: nfs.example.com:/vol1
options: rw,rsize=8192,wsize=8192
fstype: nfs
old_log_file_mount:
name: /mnt/vol2
device: nfs.example.com:/vol2
fstype: nfs
This module manages /etc/exports
though does not manage its contents.
Suggest using the file_line
resource in your profile as demonstrated
below.
class profile::nfs_server {
include ::nfs
file_line { 'exports_home':
path => '/etc/exports',
line => '/home 192.168.42.0/24(sync,no_root_squash)',
}
file_line { 'exports_data':
path => '/etc/exports',
line => '/data 192.168.23.0/24(sync,no_root_squash,rw)',
}
}
This module contains ext/fstabnfs2yaml.rb
, which is a script that will
parse /etc/fstab
and print out the nfs::mounts hash in YAML with which
you can copy/paste into Hiera.