Steffen,

Honestly I think the best solution for you is to rewrite your auto_home.sh and use the "program" map-type of autofs.  Like this

/etc/auto.master:

/home  program:/usr/local/bin/auto_home.sh

where auto_home.sh looks for the existence of a share /fs1/home/$USER.   (autofs passes in key on on the command line to program map-types.  see auto.master man page).  If it finds said share, it'll return fs1:/home/$KEY, if not fs2:/home/$KEY.

Your auto_home.sh will output either:

    /home/$KEY  -ro,tcp,soft,intr,nolock,vers=3    fs1:/home/$KEY

or

    /home/$KEY  -ro,tcp,soft,intr,nolock,vers=3    fs2:/home/$KEY 

(Your NFS mount options will vary, of course.)

There are multiple other solutions too (some involving sssd), but they all seem to involve ongoing maintenance when you add / remove users and home directories on your NAS shares.  The above solution doesn't require ongoing maintenance.

Spike 


On Fri, Oct 16, 2020 at 2:30 AM Steffen Schmidt <schmidt.steffen@gmx.de> wrote:
Hi Spike,
the auto_home.sh is choosing the fileserver per-user - it checks for the homeDirectory (e.g. /fs1/home/$USER) and therefore mounts fs1:/home/$USER

I guess your solution would be more elegant. I like the idea providing autofs via ssd. However, would this also work for my mixed user scenario (client machine needs to mount nfs homes from different locations at the same time)?

Steffen
_______________________________________________
sssd-users mailing list -- sssd-users@lists.fedorahosted.org
To unsubscribe send an email to sssd-users-leave@lists.fedorahosted.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedorahosted.org/archives/list/sssd-users@lists.fedorahosted.org