Skip to content
Manage systemd automounts with Puppet
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


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.


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


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 at the local directory /mnt.

 systemd_automount::config { '/mnt' :
  source  => '',
  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 // at the local directory /mountpoint1 and the NFS4 share at the directory /mountpoint2.

     'source'  : '//'
     'fstype'  : 'cifs'
     'running' : 'false'
     'source'  : ''


Public Classes


Main class

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


Realizes the configuration of the systemd automount units

  • 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


Parameter class. Default parameters are defined here.


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