Skip to content
README.rst 1.89 KiB
Newer Older
nimrod's avatar
nimrod committed
ansible-openldap
nimrod's avatar
nimrod committed
################
nimrod's avatar
nimrod committed

Ansible role for installing OpenLDAP, phpLDAPadmin and daily backup.

Requirements
------------

- Debian Jessie.

Role Variables
--------------

::
    openldap_organization: '{{ ansible_domain }}' #Organization name, defaults to the domain name.
    openldap_domain: '{{ ansible_domain }}' #LDAP domain, converted to ldap formatted. Defaults to the domain name of the machine.
    openldap_basedn: #LDAP base distinguished name, defaults to machine's domain converted to LDAP format.
    openldap_password: #Password for admin account, must be set.
    openldap_tls_cert: /etc/ssl/certs/ssl-cert-snakeoil.pem #TLS cert.
    openldap_tls_key: /etc/ssl/private/ssl-cert-snakeoil.key #TLS key.
    openldap_tls_ca_cert: '{{ openldap_tls_cert }}' #TLS cert for CA.
nimrod's avatar
nimrod committed

Dependencies
------------

None.

Example Playbook
----------------

::
nimrod's avatar
nimrod committed
    - hosts: servers
      roles:
         - role: ansible-openldap
           openldap_tls_cert: /etc/ssl/certs/internal.pem
           openldap_tls_key: /etc/ssl/private/internal.key
nimrod's avatar
nimrod committed

License
-------

MIT

Author Information
------------------

Nimrod Adar.

Restore procedure
-----------------

Deleting existing basedn: ::
nimrod's avatar
nimrod committed
    ldapdelete -Y EXTERNAL -r #Run as root, no password needed.
    ldapdelete -rxWD "cn=admin,dc=example,dc=com" #Run as any user, asks for OpenLDAP admin password.
nimrod's avatar
nimrod committed

Restoring from backup: ::
nimrod's avatar
nimrod committed
    ldapadd -Y EXTERNAL -f backup.ldif #Run as root, no password needed.
    ldapadd -xWD "cn=admin,dc=example,dc=com -f backup.ldif #Run as any user, asks for OpenLDAP admin password.
nimrod's avatar
nimrod committed

TODO
----

nimrod's avatar
nimrod committed
- dhparams https://weakdh.org/sysadmin.html.
nimrod's avatar
nimrod committed
- Test cipher list with diffrent clients.
nimrod's avatar
nimrod committed
- Test backup script.
nimrod's avatar
nimrod committed
- Log to syslog (Apache as well).
- Metrics (also Apache).
nimrod's avatar
nimrod committed
- Testing (ldaps, backup and restore).
nimrod's avatar
nimrod committed
- Configure all preseeding via ldap modules (keep preseeding, or maybe just
  reconfigure the package if the debconf answers change?).