FreeIPA provides a nice way to create automount maps and store them in the replicated ldap tree which allows you to have user's homedirs on a central storage server and mount them on demand to each server.
First up, let's prepare the nfs server for this and install the required packages and start the services
[archy@nfs ~]$ sudo yum -d 2 -y install nfs-utils
[archy@nfs ~]$ sudo systemctl enable --now nfs-server.service
With the required nfs services started already, create the export for your homedirs. I'll be using '/var/nfs/home' as my share where all homedirectories are located
[archy@nfs ~]$ echo '/var/nfs/home *.archyslife.lan(rw,secure,sync)' | sudo tee /etc/exports
[archy@nfs ~]$ sudo exportfs -rav
Next, create the automount map and automountkey in ipa
[archy@ipa ~]$ ipa automountmap-add-indirect default auto.home --mount /home/centralusers
[archy@ipa ~]$ ipa automountkey-add default auto.home --key '*' --info 'nfs.archyslife.lan:/var/nfs/home'
The only thing left to do is configure the client for automount. Luckily, the ipa-client package includes the 'ipa-client-automount' command which takes care of all the client-side configuration
[archy@client ~]$ sudo ipa-client-automount
When the client config is done, make sure the rpc-gssd, rpcbind and nfsidmapd services start on boot on the client since they were configured by the 'ipa-client-automount' script.
[archy@client ~]$ sudo systemctl enable --now rpc-gssd.service rpcbind.service nfs-idmapd.service
Important: the homedir for each user has to be created manually on the storage server so once they are present, they will be automatically mounted on user login.
Feel free to comment and / or suggest a topic.
Comments
Post a Comment