pam_mount

Configure pam_mount mount points

Requirements

It requires the pam module to work properly.

Role Variables

pam_mount_conf

If set to true this role is going to be applied.

pam_mount_debug

If set to true, pam_mount provides some debug information

pam_mount_volumes_*

Define several variables beginning with pam_mount_volumes on different levels of the inventory i.e.

  • pam_mount_volumes_host
  • pam_mount_volumes_host1
  • pam_mount_volumes_group

All defined volumes are beeing merged an written to the pam_mount config file. It is even possible to set some pam_mount volumes from other roles.

This pam_mount_volumes_* variables need to contain a list of dictionaries. The keys of the dictionary that defines a volumes have to correspond to the volume options that can be found in pam_mount.conf the manual pages https://manpages.ubuntu.com/manpages/jammy/man5/pam_mount.conf.5.html

For example if you want to have a specific cifs share beeing mounted to /home/$user during login define it as follows:

 pam_mount_volumes_host:
   - fstype: "cifs"
     server: "nash.d.ethz.ch"
     path: "mtec-home/%(USER)"
     mountpoint: "/home/%(USER)"
     options: "domain=D.ETHZ.CH"
     uid: "1000-10000000000"

Or to define a local bind mount from i.e your local home directory on /local/home/$user to /home/$user define the volume as follows

  pam_mount_volumes_host:
    - fstype: "auto"
      path: "/local/home/%(USER)"
      mountpoint: "/home/%(USER)"
      options: "bind"
      uid: "1000-10000000000"

License

BSD

Author Information

thomber@ethz.ch on behalf of the ETH Linux Squad