Skip to content

🔧 An Ansible role to add or remove Systemd mounts on Linux systems.

License

Notifications You must be signed in to change notification settings

aisbergg/ansible-role-systemd-mounts

Repository files navigation

Ansible Role: aisbergg.systemd_mounts

This Ansible role adds or removes Systemd mounts on Linux systems.

Requirements

  • System needs to be managed with Systemd

Role parameters

Bold variables are required.

Variable Default Comments
systemd_mounts [] List of Systemd mounts to be created.
systemd_mounts[].after Refer to official documentation on After.
systemd_mounts[].before Refer to official documentation on Before.
systemd_mounts[].default_dependencies true Refer to official documentation on DefaultDependencies.
systemd_mounts[].description 'mount ' ~ mount.where Refer to official documentation on Description.
systemd_mounts[].force_unmount Refer to official documentation on ForceUnmount.
systemd_mounts[].lazy_unmount Refer to official documentation on LazyUnmount.
systemd_mounts[].mode Refer to official documentation on DirectoryMode.
systemd_mounts[].options Refer to official documentation on Options.
systemd_mounts[].read_write_only Refer to official documentation on ReadWriteOnly.
systemd_mounts[].requires Refer to official documentation on Requires.
systemd_mounts[].sloppy_options Refer to official documentation on SloppyOptions.
systemd_mounts[].timeout Refer to official documentation on TimeoutSec.
systemd_mounts[].type Refer to official documentation on Type.
systemd_mounts[].wants Refer to official documentation on Wants.
systemd_mounts[].what Refer to official documentation on What.
systemd_mounts[].where Refer to official documentation on Where.
systemd_mounts[].auto_mount false Add also an automount unit.
systemd_mounts_clear false Remove undefined mount points from /etc/systemd/system. Only mounts managed with Ansible will remain.

Example Playbook

- hosts: all
  vars:
    systemd_mounts_clear: false
    systemd_mounts:
      - what: "172.16.24.192:/mnt/things"
        where: /mnt/things
        type: nfs
        options: auto

  roles:
    - aisbergg.systemd_mounts

License

MIT

Author Information

Andre Lehmann ([email protected])