[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: OpenLDAP + autofs integration



On Sun, 1 Apr 2001, James Macnicol wrote:

> Hello,
> 
> 	My apologies if this isn't *quite* on topic but I'm looking for
> examples of how to use the LDAP integration in Linux's autofs
> automounter (in this case with OpenLDAP as the server platform).
> Documentation for this is *very* difficult to find.  I'd be interested
> to know if you could, in fact, store the automount moint points in the
> LDAP database as well so that in the case of your primary fileserver
> failing it would be possible to switch all clients over to a backup by
> modifying a single entry.
> 

How how it goes...

o  get autofs 3.1.5 or greater (make sure yo compile in LDAP support)

o edit /etc/auto.master and define the DN used as the seach base
  e.g. /home  ldap:ou=auto.home,dc=plainjoe,dc=org    --timeout 60

o now add the following schema to OpenLDAP (you'll also need to 
  include the nis.schema file)

attributetype ( 1.3.6.1.1.1.1.25 NAME 'automountInformation'
        DESC 'Automount information'
        EQUALITY caseExactIA5Match
        SUBSTR caseExactIA5SubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{1024} SINGLE-VALUE )
 
objectclass ( 1.3.6.1.1.1.2.13 NAME 'automount' SUP top STRUCTURAL
        DESC 'Automount information'
        MUST ( cn $ automountInformation )
        MAY ( description ) )


o use the padl migration tools to convert /etc/auto.home over to
  LDIF (however you will need to change the reference to the 
  automountMap objectClass to an organizationalUnit).  Here's an
  example

  dn: ou=auto.opt,dc=plainjoe,dc=org
  objectClass: top
  objectClass: organizationalUnit
  ou: auto.opt

  dn: cn=applix, ou=auto.opt,dc=plainjoe,dc=org
  objectClass: automount
  automountInformation: -rw,hard,intr pogo:/export/applix
  cn: applix

o You will also need to define an ldap.conf for autofs to use.
  I added these lines to the autofs startup script

  ## These are needed to define the hostname used in 
  ## LDAP queries by autofs
  LDAPCONF=/etc/ldap.autofs
  export LDAPCONF

  and created /etc/ldap.autofs

  ## /etc/ldap.autofs
  ## Define the hostname of the LDAP server used by autofs
  HOST	tumnus.plainjoe.org



This should be enough to get you going.  Let me know if you
have any other questions.  




CHeers, jerry
----------------------------------------------------------------------
   /\  Gerald (Jerry) Carter                     Professional Services
 \/    http://www.valinux.com/  VA Linux Systems   gcarter@valinux.com
       http://www.samba.org/       SAMBA Team          jerry@samba.org
       http://www.plainjoe.org/                     jerry@plainjoe.org

       "...a hundred billion castaways looking for a home."
                                - Sting "Message in a Bottle" ( 1979 )