ypsman.systemd_mounts
systemd Mounts
This guide explains how to set up mounts using a systemd Service.
The Playbook creates a systemd Service to mount shared folders, allowing you to manage mounts as a system service.
It works on Debian Stretch and Jessie if you’re using systemd.
Commands:
systemctl status mount-point.mount # Check the status of the mount
systemctl start mount-point.mount # Start the mount
systemctl stop mount-point.mount # Stop the mount
Configuration Options:
- Appdir: # Description of the Service
- share: //apps.local/apps$ # The shared folder to mount from
- mount: /opt/app # The local folder to mount into
- type: nfs # Type of the mount (refer to the mount manual)
- options: uid=1000 # Mount options like username...
- automount: false # If false: the service will mount at boot # If true: mounts when the folder is accessed and at boot
Example Playbook
- hosts: all
roles:
- role: systemd-mounts
mounts:
myLogDir:
share: //logserver.local/logs$ # Shared logs folder
mount: /mnt/logs # Local mount point
type: cifs # Type of mount
options: domain=local,username=user,password=password,uid=1000,gid=1000 # Mount options
automount: true # Enable automount
Appdir:
share: //apps.local/apps$ # Shared apps folder
mount: /opt/app # Local mount point
type: nfs # Type of mount
options: uid=1000 # Mount options
automount: false # Do not enable automount