Manage systemd automounts with Puppet
- Description
- Setup - The basics of getting started with systemd_automount
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
This Puppet module can be used to manage Systemd automount units.
- Puppet >= 4
Currently only these OS variants are tested, although other OS distributions with systemd should also work.
- Redhat/CentOS >= 7
- SLES >= 12
- openSUSE Leap >= 42
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'
}
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'
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: presentdump
: fstab dump entry. See "man fstab".
Type: integer
Default: 0pass
: fstab pass entry. See "man fstab".
Type: integer
Default: 0atboot
: 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: truerunning
: Set this to false to disable the systemd mount unit.
Type: boolean
Default: true
Parameter class. Default parameters are defined here.
- This Module is limited to Puppet Version >= 4
- This Module only supports systemd automount configurations