Red Hat Training

A Red Hat training course is available for RHEL 8

19.6. LDAP で自動マウント機能マップの格納

この手順では、autofs マップファイルではなく、LDAP 設定で自動マウント機能マップを格納するように autofs を設定します。

前提条件

  • LDAP から自動マウント機能マップを取得するように設定されているすべてのシステムに、LDAP クライアントライブラリーをインストールする必要があります。Red Hat Enterprise Linux では、openldap パッケージは、autofs パッケージの依存関係として自動的にインストールされます。

手順

  1. LDAP アクセスを設定するには、/etc/openldap/ldap.conf ファイルを変更します。BASEURIschema の各オプションがサイトに適切に設定されていることを確認します。
  2. 自動マウント機能マップを LDAP に格納するためにデフォルトされた最新のスキーマが、rfc2307bis ドラフトに記載されています。このスキーマを使用する場合は、スキーマの定義のコメント文字を取り除き、/etc/autofs.conf 設定ファイル内に設定する必要があります。以下に例を示します。

    例19.6 autofs の設定

    DEFAULT_MAP_OBJECT_CLASS="automountMap"
    DEFAULT_ENTRY_OBJECT_CLASS="automount"
    DEFAULT_MAP_ATTRIBUTE="automountMapName"
    DEFAULT_ENTRY_ATTRIBUTE="automountKey"
    DEFAULT_VALUE_ATTRIBUTE="automountInformation"
  3. 他のすべてのスキーマエントリーが設定内でコメントされていることを確認してください。rfc2307bis スキーマの automountKey 属性は、rfc2307 スキーマの cn 属性に置き換わります。以下は、LDAP データ交換形式 (LDIF) 設定の例です。

    例19.7 LDIF 設定

    # auto.master, example.com
    dn: automountMapName=auto.master,dc=example,dc=com
    objectClass: top
    objectClass: automountMap
    automountMapName: auto.master
    
    # /home, auto.master, example.com
    dn: automountMapName=auto.master,dc=example,dc=com
    objectClass: automount
    automountKey: /home
    automountInformation: auto.home
    
    # auto.home, example.com
    dn: automountMapName=auto.home,dc=example,dc=com
    objectClass: automountMap
    automountMapName: auto.home
    
    # foo, auto.home, example.com
    dn: automountKey=foo,automountMapName=auto.home,dc=example,dc=com
    objectClass: automount
    automountKey: foo
    automountInformation: filer.example.com:/export/foo
    
    # /, auto.home, example.com
    dn: automountKey=/,automountMapName=auto.home,dc=example,dc=com
    objectClass: automount
    automountKey: /
    automountInformation: filer.example.com:/export/&