ktooi / ansible-role-slapd

Install and configure slapd for RHEL/CentOS and Debian/Ubuntu.

Home Page:https://galaxy.ansible.com/ktooi/slapd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CI

Ansible Role: slapd

RHEL/CentOS, Debian/Ubuntu サーバに slapd をインストールし、基本的な設定を行います。

この role では次のことを行います。

  • LDAP サーバのインストール
  • LDAP サーバの基本設定
  • BaseDN の設定
  • 管理者権限の設定
  • スキーマのインポート
  • モジュールのインポート

この role では次のことを行いません。

  • アカウントやグループなどのエントリ情報の登録

Requirements

この role には特別な要件はありません。

Role Variables

# Set this to the slapd global configurations.
slapd_loglevel: stats
# slapd_idletimeout: 86400
# slapd_sizelimit: 500
# slapd_referral: on

OpenLDAP Software 2.4 Administrator's Guide: Configuring slapd

# Users credential.
slapd_passwd_scheme: '{SSHA}'
ldap_root_passwd: "root_passwd"
ldap_admin: "cn=admin"
# Set this if different from the ldap_basedn.
# ldap_admin_base: "dc=example,dc=com"
ldap_admin_passwd: "admin_passwd"
# If you want to reduce the number of tasks
# that are "Changed", specify the hash
# that you generated beforehand using the following slappasswd command.
# $ slappasswd -h '{SSHA}'
# ldap_root_hashed_passwd: '{SSHA}WA/exo2HKC1H4EsOUxGbWU6mW0eT1A1K'
# ldap_admin_hashed_passwd: '{SSHA}a5gsMFahundHCuqNYeVrhX3QO6ZXCI+/'

slapd の管理権限を設定します。

# Select whether or not to install the schemas.
slapd_install_schema_cosine: true
slapd_install_schema_nis: true
slapd_install_schema_samba3: true
slapd_install_schema_misc: false
slapd_install_schema_ssh_lpk: false
slapd_install_schema_sudo: false

インストールするスキーマを指定します。

true に設定することでスキーマがインストールされます。 false に設定するとスキーマはインストールされません。

一度インストールしたスキーマは、 false に設定してもアンインストールされません。

slapd_schema_cosine_dn: null
slapd_schema_misc_dn: null
slapd_schema_nis_dn: null
slapd_schema_samba3_dn: null
slapd_schema_lpk_dn: null
slapd_schema_sudo_dn: null

インストールするスキーマの DN を指定します。

デフォルトでは自動的に適切な DN を選択します。 何らかの不都合がある場合にのみ指定してください。

# Select whether or not to install the modules.
slapd_install_module_refint: false
slapd_install_module_memberof: false
slapd_install_module_syncprov: false

インストールするモジュールを指定します。 RHEL/CentOS 7 ではタスクに失敗するのでこれらの変数を true に設定してはいけません。

true に設定することでモジュールがインストールされます。 false に設定するとモジュールはインストールされません。

一度インストールしたモジュールは、 false に設定してもアンインストールされません。

slapd_module_memberof_dn: null
slapd_overlay_memberof_dn: null
slapd_module_refint_dn: null
slapd_overlay_refint_dn: null
slapd_module_syncprov_dn: null
slapd_overlay_syncprov_config_dn: null
slapd_overlay_syncprov_dn: null

インストールするモジュールの DN を指定します。

デフォルトでは自動的に適切な DN を選択します。 何らかの不都合がある場合にのみ指定してください。

Replication

LDAP サーバのレプリケーションを設定します。 この role では N-Way Multi-Provider 方式のレプリケーションに対応しています。

slapd_replication: false

レプリケーションを設定する場合は slapd_replicationtrue を指定してください。 RHEL/CentOS 7 ではタスクに失敗するのでこの変数を true に設定してはいけません。

slapd_replication_group: 'slapd'

レプリケーションを実施するホストの Ansible Inventory のグループ名を指定してください。 この role は、ここで指定されたグループ内のホストでレプリケーションを構成します。

# slapd_replication_target_list:
#   - id: 1
#     url: "ldap://ldap01.example.com"
#   - id: 2
#     url: "ldap://ldap02.example.com"

レプリケーションを実施するホストをリストで指定します。 通常の場合は slapd_replication_group にて指定した Ansible Inventory のグループから自動的に定義されるので、指定する必要はありません。 接続先を Ansible に指定したホスト名ではなく、 IP で指定したい場合や、 Ansible 管轄外のホストとレプリケーションする場合などに指定が必要となるかもしれません。

id キーは rid として、 url キーは provider として指定されます。

Dependencies

None.

Example Playbook

- hosts: ldap-servers
  vars_files:
    - vars/main.yml
  roles:
    - slapd

Inside vars/main.yml :

ldap_basedn: dc=your,dc=domain,dc=example,dc=com
ldap_organization_name: Your Example Co., Ltd.

ldap_root_passwd: "root_passwd"
ldap_admin: "cn=Manager"
ldap_admin_passwd: "Manager_p@55w0rd"
ldap_base_head: your
ldap_domain: your.domain.example.com

これらの変数の値は ldap_basedn から自動的に計算されますが、別の値を利用したい場合は定義してください。

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Install and configure slapd for RHEL/CentOS and Debian/Ubuntu.

https://galaxy.ansible.com/ktooi/slapd

License:MIT License


Languages

Language:Jinja 100.0%