#1268 No link from automount indirect maps to key or parent
Closed: Fixed None Opened 12 years ago by admiyo.

ipa autmountmap-add-indirect creates a key object inside the parent map. However, there is no way from a map to navigate to its parent map. Nothing returned from the API indicates that the map is indirect, which is its parent map, nor what its mount point is.


All maps, direct or indirect, navigate to auto.master. There is no nesting.

It is true that the map itself cannot distinguish itself between indirect and direct, that is the way the schema is done.

In terms of data storage the only difference between a direct and indirect map is that a direct map has a key of /-.

The maps themselves aren't all that interesting, it is the keys where all the real data is.

The problem is an implementation one. There are no nested maps, just a map with a key pointing to another map. The --parentmap thing was done wrong and is very misleading.

The basic syntax of a submount key is :

 <key>          the name of the subdirecctory
 <maporigin>    how you retrieve your maps: file, yp, nisplus, hesiod,
                program
 <mapname>      for filemaps a full path eg. /etc/auto.cd, for yp the
                mapname eg. auto.cd

A working example looks like:

/etc/auto.master:
/-      /etc/auto.direct
/share  /etc/auto.share
---------------------------
/etc/auto.direct:
---------------------------
/etc/auto.share:
share   attic:/share
sub     -fstype=autofs ldap:auto.sub

maps not connected to /etc/auto.master:
---------------------------
/etc/auto.sub: 
share   attic:/share

# ls /share/sub/share
<files from the NFS share>

This set of maps was created with a test patch with:

$ ipa automountlocation-add baltimore
$ ipa automountmap-add-indirect baltimore auto.share --mount=/share
$ ipa automountmap-add-indirect baltimore --parentmap=auto.share --mount=sub auto.sub
$ ipa automountkey-add baltimore auto.sub --key=share --info=attic:/share
$ ls /share/sub/share
builds  lost+found

So basically a submount is just a way to mount a map on a mount point within another map.

This submount map does not need to be referenced in auto.master, though it can.

If you want to try to create links from one of these keys to another map you need to use the automountinformation attribute. The map name is the value on the right side of the colon. We will only create ldap pointers but in theory this value could be file, pointing to a file-based map (it is possible to mix file and network maps).

A testing tip. Creating the maps is one thing, ensuring they work is another. If you configure a client to support automount against your test map you can run automount in the foreground and see the map processing (to some extent).

Run: # automount -fdv

It would also be a good idea to export some filesystems over NFS and test that thing are actually mounted as they should.

Metadata Update from @admiyo:
- Issue assigned to rcritten
- Issue set to the milestone: FreeIPA 2.2 Core Effort - 2012/01

7 years ago

Login to comment on this ticket.

Metadata