Skip to content
Manage systemd automounts with Puppet
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
lib/puppet/functions/systemd_automount
manifests
spec
CHANGELOG.md
Gemfile
Gemfile.lock
README.md
Rakefile
appveyor.yml
metadata.json

README.md

systemd_automount

Manage systemd automounts with Puppet

Table of Contents

  1. Description
  2. Setup - The basics of getting started with systemd_automount
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Limitations - OS compatibility, etc.

Description

This Puppet module can be used to manage Systemd automount units.

Supported Puppet versions

  • Puppet >= 4

Tested OS Versions

Currently only these OS variants are tested, although other OS distributions with systemd should also work.

  • Redhat/CentOS >= 7
  • SLES >= 12
  • openSUSE Leap >= 42

Usage

Example: Using Code

You can use the funtionality of this module in your own .pp files by using the defined resource type systemd_automount::config. The list of associated parameters can be found here: Parameters

The code below will mount the remote NFSv3 share 192.168.100.1:/share at the local directory /mnt.

 systemd_automount::config { '/mnt' :
  source  => '192.168.100.1:/share',
  fstype  => 'nfs',
  options => 'vers=3'
 } 

Example: Using YAML (Hiera)

The main class systemd_automount provides the parameter mounts which only accepts a hash value. The list of associated parameters can be found here: Parameters

The following example will mount the remote CIFS/SMB share //192.168.100.1/smb at the local directory /mountpoint1 and the NFS4 share 192.168.200.2:/exports/nfs4 at the directory /mountpoint2.

 systemd_automount::mounts:
   '/mountpoint1':
     'source'  : '//192.168.100.1/smb'
     'fstype'  : 'cifs'
     'running' : 'false'
   '/mountpoint2':
     'source'  : '192.168.200.2:/exports/nfs4'

Reference

Public Classes

systemd_automount

Main class

Parameters
  • mounts : This parameter accepts an hash describing one or multiple Systemd automount entries. Have a look at class systemd_automount::config to get information about the possible parameters.

systemd_automount::config

Realizes the configuration of the systemd automount units

Parameters
  • mountpoint : Directory to use as mountpoint for the source device.
    Type: string
    Default: undef
    Example: '/mnt'
  • source : Source device or network filesystem
    Type: string
    Default: undef
    Example: 'nfsserver:/my/share', 'cifsserver://share'
  • fstype : Filesystem type
    Type: string
    Default: nfs4
    Example: 'nfs', 'cifs'
  • options : Mount options separated by ","
    Type: string
    Default: empty
    Example: 'sec=krb5p,intr,noacl'
  • ensure : Set this parameters value to "absent" to remove the automount entry.
    Type: string
    Default: present
  • dump : fstab dump entry. See "man fstab".
    Type: integer
    Default: 0
  • pass : fstab pass entry. See "man fstab".
    Type: integer
    Default: 0
  • atboot : Set this to "false" if you don't want the filesystem to be active after reboot or when "mount -a" is given.
    Type: boolean
    Default: true
  • running : Set this to false to disable the systemd mount unit.
    Type: boolean
    Default: true

Private Classes

systemd_automount::params

Parameter class. Default parameters are defined here.

Limitations

  • This Module is limited to Puppet Version >= 4
  • This Module only supports systemd automount configurations
You can’t perform that action at this time.