Forge Home

nfs

Manage NFS

26,038 downloads

2,841 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 2.3.0 (latest)
  • 2.2.0
  • 2.0.0
  • 1.13.0
  • 1.12.1
  • 1.12.0
  • 1.11.2
  • 1.11.1 (deleted)
  • 1.11.0
  • 1.10.0
  • 1.9.0
  • 1.8.1
  • 1.8.0
  • 1.7.0
  • 1.6.3
  • 1.6.1
  • 1.6.0
  • 1.5.0
  • 1.4.0
  • 1.3.0
  • 1.2.0
  • 1.1.0
released Nov 13th 2019
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.0.0 < 7.0.0
  • , , , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'ghoneycutt-nfs', '2.3.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add ghoneycutt-nfs
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install ghoneycutt-nfs --version 2.3.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download
Tags: nfs, rpcbind, idmap

Documentation

ghoneycutt/nfs — version 2.3.0 Nov 13th 2019

puppet-module-nfs

Build Status

Puppet module to manage NFS client and server

Components

Server


  • Manage NFS server
  • Setup of exports

Idmap


  • Manage idmapd
  • Setup of configuration for idmapd

Compatibility

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)

Suse notes

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

===

Parameters

hiera_hash

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

nfs_package

Name of the NFS package. May be a string or an array.

  • Default: Uses system defaults as specified in module

nfs_service

Name of the NFS service

  • Default: Uses system defaults as specified in module

mounts

Hash of mounts to be mounted on system. See below.

  • Default: undef

server

Boolean to specify if the system is an NFS server.

  • Default: false

exports_path

The location of the config file.

  • Default: '/etc/exports'

exports_owner

The owner of the config file.

  • Default: 'root'

exports_group

The group for the config file.

  • Default: 'root'

exports_mode

The mode for the config file.

  • Default: '0644'

===

Class nfs::idmap

Parameters

idmap_package

String of the idmap package name.

  • Default: Uses system defaults as specified in module

idmapd_conf_path

The location of the config file.

  • Default: '/etc/idmapd.conf'

idmapd_conf_owner

The owner of the config file.

  • Default: 'root'

idmapd_conf_group

The group for the config file.

  • Default: 'root'

idmapd_conf_mode

The mode for the config file.

  • Default: '0644'

idmapd_service_name

String of the service name.

  • Default: Uses system defaults as specified in module

idmapd_service_ensure

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

idmapd_service_enable

Boolean value of enable parameter for idmapd service.

  • Default: true

idmapd_service_hasstatus

Boolean value of hasstatus parameter for idmapd service.

  • Default: true

idmapd_service_hasrestart

Boolean value of hasrestart parameter for idmapd service.

  • Default: true

idmap_domain

String value of domain to be set as local NFS domain.

  • Default: $::domain

ldap_server

String value of ldap server name.

  • Default: undef

ldap_base

String value of ldap search base.

  • Default: undef

local_realms

String or array of local kerberos realm names.

  • Default: $::domain

translation_method

String or array of mapping method to be used between NFS and local IDs. Valid values is nsswitch, umich_ldap or static.

  • Default: 'nsswitch'

nobody_user

String of local user name to be used when a mapping cannot be completed.

  • Default: 'nobody'

nobody_group

String of local group name to be used when a mapping cannot be completed.

  • Default: 'nobody'

verbosity

Integer of verbosity level.

  • Default: 0

pipefs_directory

String of the directory for rpc_pipefs.

  • Default: undef - Uses system defaults as specified in module

===

Manage mounts

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.

Example:

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

Manage exports

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)',
  }
}

Creating Hiera data from existing system

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.