Forge Home

nfs

Manage nfs mounts and exports

9,852 downloads

9,665 latest version

4.4 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.

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.

Download

Documentation

jackson/nfs — version 0.1.1 Jan 23rd 2015

nfs

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

Overview

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.

Setup

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

Usage

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. ['192.168.1.0/24', '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:

nfs::export_defaults:
    clients:
        - 192.168.1.0/24
    options:
        - ro
        - all_squash
nfs::exports:
    /srv/myshare:
        clients:
            - mylaptop
        options:
            - async
            - no_subtree_check
nfs::mount_defaults:
    ensure: present
    fstype: nfs
    dump:   0
    pass:   0
    options: defaults
nfs::mounts:
    /shared/myserver:
        device: myserver:/srv/nfs

Reference

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.

Limitations

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