Thanks for the reply.
My file based maps are as such:
basically blank auto.master that includes auto.master.d
/etc/auto.master.d/foo.autofs:
/foo/x /etc/automap/x.txt
/foo/x/dev /etc/automap/x_dev.txt
foo/x/prod /etc/automap/x_prod.txt
/foo/z /etc/automap/z.txt
/etc/automap/x.txt:
dir1 -fstype=nfs4 server1:/share_dir1
dir2 -fstype=nfs4 server2:/share_dir2
/etc/automap/x_dev.txt:
dir3 -fstype=nfs4 devserver1:/share_dir3
dir4 -fstype=nfs4 devserver2:/share_dir4
/etc/automap/x_prod.txt:
dir3 -fstype=nfs4 prodserver1:/share_dir3
dir4 -fstype=nfs4 prodserver2:/share_dir4
/etc/automap/z.txt:
dir5 -fstype=nfs4 server5:/share_dir5
Such a map might not make a lot of sense if you were designing from scratch, but what I'm actually doing is mapping our Windows DFS namespace "\\foo" in Active Directory where a lot of apps have been written to use just one global namespace, to now be available under linux in the same way at /foo . This will greatly minimize the effort when having these apps migrate and run under linux, or in some situations, be completely cross platform apps with very minor settings to them to make them work under windows vs. linux (mostly python apps)
Anyway, so as I have it above, as long as my indirect map in foo.autofs is ordered the way I have above, then everything works fine, and I will end up with:
/foo/x
/foo/x/dir1
/foo/x/dir2
/foo/x/dev/
/foo/x/dev/dir3
/foo/x/dev/dir4
/foo/x/prod/
/foo/x/prod/dir3
/foo/x/prod/dir4
/foo/z
When I model this in LDAP (via sssd) however, I can see the maps perfectly fine in automap -m
but the order in which they're returned results in some of the parent paths masking their nested children.
i.e.
if /foo/x/dev gets mounted first, and then /foo/x/prod, followed by /foo/x
It will result in me seeing just
/foo/x/dir1
/foo/x/dir2
The moment I umount /foo/x I will then see
/foo/x/dev/... and /foo/x/prod/...
Hopefully that makes sense.
I had previously done hierarchical maps with something like:
auto.master
/foo /etc/automount/foo.txt
/etc/automount/foo.txt:
x \
dir1 ... \
dir2 .... \
dev/dir3 ....\
dev/dir4 ... \
prod/dir3 ...\
prod/dir4 ...
And that worked, but it had the huge burden that any traversal to a path under /foo/x meant that ALL mounts got mounted at once, which was quite undesirable.
Would you have a recommendation on how this might be better authored in ldap? As I said, I must unfortunately follow the namespace as is.
Thanks again