Forge Home


Manage nfs mounts and exports


9,442 latest version

4.4 quality score

Version information

  • 0.1.1 (latest)
  • 0.1.0
released Jan 23rd 2015

Start using this module

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

Add this module to your Puppetfile:

mod 'jackson-nfs', '0.1.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install jackson-nfs --version 0.1.1

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.



jackson/nfs — version 0.1.1 Jan 23rd 2015


Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with nfs
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how


This is a puppet module for controlling your nfs mounts and exports. Configure your mounts and exports with hiera. Tested on rhel, centOS, and ubuntu.

Module Description

This modules installs the nfs packages and ensures the service is runnng. It uses augeas and templates to manage the exports file and the puppet mount resource to manage your mounts.


What nfs affects

  • Affects /etc/fstab and /etc/exports.
  • Creates all mount points.
  • Installs nfs package.
  • Configures nfs service.

Setup Requirements

Requires hiera and merge_deep for mount and export lookups. Requires augeas for managing exports.

Beginning with nfs

The simplest use is to install and start the nfs service.

In manfiests/site.pp:

include nfs

In hieradata/common.yaml:

nfs::package: nfs
nfs::service: nfsd


This module has one class:

class { 'nfs' :
    package => # The NFS package to install. Can be an array, e.g. 'nfs'
    service => # The NFS service to run. Can be an array, e.g. 'nfsd'

This module has 1 defined type:

nfs::export { 'resource title' :
    share   => # The full path of the directory you want to share, e.g. /srv/nfs. Defaults to title.
    clients => # An array of computers to share with, e.g. ['', 'mylaptop']
    options => # An array of options for the share, e.g. ['rw', 'async', 'no_subtree_check']

The nfs class also includes the following optional hiera hashes:

nfs::exports:          # A hash containing all the nfs::export resources.
nfs::export_defaults:  # A hash of defaults for the nfs::export resource.
nfs::mounts:           # A hash containing all the mount resources for you nfs mounts.
nfs::mount_defaults:   # A hash of defaults for the mount resource.

Example lookups for common.yaml:

        - ro
        - all_squash
            - mylaptop
            - async
            - no_subtree_check
    ensure: present
    fstype: nfs
    dump:   0
    pass:   0
    options: defaults
        device: myserver:/srv/nfs


The nfs class will create a file resource for each mountpoint to ensure the directories exist. The nfs::export only touches the /etc/exports file with augueas. It won't replace the file.


Tested with rhel, centOS, and ubuntu. Should work fine as long as you have augeas and merge_deep.