Puppet module to manage NFS client and server
- Manage NFS server
- Setup of exports
- Manage idmapd
- Setup of configuration for idmapd
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.
- EL 6
- EL 7
- EL 8
- Solaris 10 (client only)
- Solaris 11 (client only)
- Suse 11 (client only)
- Suse 12 (client only)
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.
- Default: true
Name of the NFS package. May be a string or an array.
- Default: Uses system defaults as specified in module
Name of the NFS service
- Default: Uses system defaults as specified in module
Hash of mounts to be mounted on system. See below.
- Default: undef
Boolean to specify if the system is an NFS server.
- Default: false
The location of the config file.
- Default: '/etc/exports'
The owner of the config file.
- Default: 'root'
The group for the config file.
- Default: 'root'
The mode for the config file.
- Default: '0644'
===
String of the idmap package name.
- Default: Uses system defaults as specified in module
The location of the config file.
- Default: '/etc/idmapd.conf'
The owner of the config file.
- Default: 'root'
The group for the config file.
- Default: 'root'
The mode for the config file.
- Default: '0644'
String of the service name.
- Default: Uses system defaults as specified in module
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'.
- Default: Uses system defaults as specified in module
Boolean value of enable parameter for idmapd service.
- Default: true
Boolean value of hasstatus parameter for idmapd service.
- Default: true
Boolean value of hasrestart parameter for idmapd service.
- Default: true
String value of domain to be set as local NFS domain.
- Default:
$::domain
String value of ldap server name.
- Default: undef
String value of ldap search base.
- Default: undef
String or array of local kerberos realm names.
- Default:
$::domain
String or array of mapping method to be used between NFS and local IDs. Valid values is nsswitch, umich_ldap or static.
- Default: 'nsswitch'
String of local user name to be used when a mapping cannot be completed.
- Default: 'nobody'
String of local group name to be used when a mapping cannot be completed.
- Default: 'nobody'
Integer of verbosity level.
- Default: 0
String of the directory for rpc_pipefs.
- Default: undef - Uses system defaults as specified in module
===
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.