Changeset - 4c5f1593c786
[Not reviewed]
0 1 1
Branko Majic (branko) - 9 years ago 2015-08-30 19:22:46
branko@majic.rs
MAR-19: Make the ldap client configuration optional.
2 files changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
docs/rolereference.rst
Show inline comments
 
@@ -249,193 +249,193 @@ Parameters
 

	
 
  **authorized_keys** (list, optional, ``[]``)
 
    List of SSH public keys that should be deployed to user's authorized_keys
 
    truststore.
 

	
 
  **password** (string, optional, ``!`` - no password)
 
    Encrypted password that should be set for the user.
 

	
 
**os_groups** (list, optional, ``[]``)
 
  A list of operating system groups that should be set-up on a server. Each item
 
  is a dictionary with the following options describing the group parameters:
 

	
 
  **name** (string, mandatory)
 
    Name of the operating system group that should be created.
 

	
 
  **gid** (number, optional, ``whatever OS picks``)
 
    GID for the operating system group.
 

	
 
**common_packages** (list, optional, ``[]``)
 
  List of additional operating system packages that should be installed on the
 
  server. Each element of the list should be a simple string denoting the name
 
  of the package.
 

	
 
**ca_certificates** (list, optional, ``[]``)
 
  List of additional CA certificate files that should be deployed on the
 
  server. Each element of the list should be a filepath to a CA certificate file
 
  on originating (Ansible) host that should be copied to destination
 
  server.
 

	
 
**incoming_connection_limit** (string, optional, ``3/second``)
 
  Rate at which the incoming ICMP echo-request packages and new TCP connections
 
  will be accepted at. The value should be specified in the same format as value
 
  for the ``iptables hashlimit`` option ``--hashlimit-upto``.
 

	
 
**incoming_connection_limit_burst** (string, optional, ``9``)
 
  Initial burst of packages that should be accepted when the client with
 
  distinct source IP address connects to the server for the first time (usually
 
  higher than ``incoming_connection_limit``), even if it would go above the
 
  specified connection limit.
 

	
 

	
 
Examples
 
~~~~~~~~
 

	
 
Here is an example configuration for setting-up some common users, groups, and
 
packages on all servers:
 

	
 
.. code-block:: yaml
 

	
 
  ---
 

	
 
  os_users:
 
    - name: admin
 
      uid: 1000
 
      additional_groups:
 
        - sudo
 
      authorized_keys:
 
        - "{{ lookup('file', '/home/admin/.ssh/id_rsa.pub') }}"
 
      password: '$6$AaJRWtqyX5pk$IP8DUjgY0y2zqMom9BAc.O9qHoQWLFCmEsPRCika6l/Xh87cp2SnlMywH0.r4uEcbHnoicQG46V9VrJ8fxp2d.'
 
    - name: john
 
      uid: 1001
 
      password: '$6$AaJRWtqyX5pk$IP8DUjgY0y2zqMom9BAc.O9qHoQWLFCmEsPRCika6l/Xh87cp2SnlMywH0.r4uEcbHnoicQG46V9VrJ8fxp2d.'
 

	
 
  os_groups:
 
    - name: localusers
 
      gid: 2500
 

	
 
  common_packages:
 
    - emacs23-nox
 
    - screen
 
    - debconf-utils
 

	
 
  ca_certificates:
 
    - ../certs/truststore.pem
 

	
 
  incoming_connection_limit: 2/second
 

	
 
  incoming_connection_limit_burst: 6
 

	
 
.. _ldap_client:
 

	
 
LDAP Client
 
-----------
 

	
 
The ``ldap_client`` role can be used for setting-up an OpenLDAP client on
 
destination machine.
 

	
 
The role implements the following:
 

	
 
* Installs OpenLDAP client tools.
 
* Sets-up global configuration file for OpenLDAP clients at /etc/ldap/ldap.conf.
 

	
 

	
 
Parameters
 
~~~~~~~~~~
 

	
 
**ldap_client_config** (list, mandatory)
 
**ldap_client_config** (list, optional, ``[]``)
 
  A list of configuration options that should be put into the LDAP configuration
 
  file. Each item is a dictionary with the following options defining the
 
  configuration parameter:
 

	
 
  **comment** (string, mandatory)
 
    Comment that will be shown in the file just above the configuration option.
 

	
 
  **option** (string, mandatory)
 
    Name of configuration option.
 

	
 
  **value** (string, mandatory)
 
    Value for configuration option.
 

	
 

	
 
Examples
 
~~~~~~~~
 

	
 
Here is an example configuration for setting some common LDAP client options:
 

	
 
.. code-block:: yaml
 

	
 
  ---
 

	
 
  ldap_client_config:
 
    - comment: Set the base DN
 
      option: BASE
 
      value: dc=example,dc=com
 
    - comment: Set the default URI
 
      option: URI
 
      value: ldap://ldap.example.com/
 
    - comment: Set the truststore for TLS/SSL
 
      option: TLS_CACERT
 
      value: /etc/ssl/certs/example_ca.pem
 
    - commment: Force basic server certificate verification
 
      option: TLS_REQCERT
 
      value: demand
 
    - comment: Disable CRL checks for server certificate
 
      option: TLS_CRLCHECK
 
      value: none
 

	
 

	
 
LDAP Server
 
-----------
 

	
 
The ``ldap_server`` role can be used for setting-up an OpenLDAP server on
 
destination machine.
 

	
 
The role implements the following:
 

	
 
* Deploys LDAP TLS private key and certificate.
 
* Installs OpenLDAP server (package ``slapd``).
 
* Configures OpenLDAP server (base DN - domain, organisation, TLS, SSF, log levels).
 
* Sets-up separate log file for OpenLDAP server at ``/var/log/slapd.log`` (with
 
  log rotation included).
 
* Enables the ``memberof`` overlay on top of default database. The overlay is
 
  configured to keep track of membership changes for object class
 
  ``groupOfUniqueNames`` via attribute ``uniqueMember``. Enforcement of
 
  referential integrity is turned on as well (modifications of ``memberof``
 
  attribute will update corresponding group as well.
 
* Configures permissions.
 
* Creates LDAP entries.
 
* Configures firewall to allow incoming connections to the LDAP server.
 

	
 

	
 
Parameters
 
~~~~~~~~~~
 

	
 
**ldap_server_config** (list, mandatory)
 
  A dictionary of configuration options for OpenLDAP server. The following
 
  configuration options are available:
 

	
 
  **domain** (string, mandatory)
 
    Domain that should be used for constructing the base DN of default user LDAP
 
    database. This should be a sub-domain dedicated to organisation. The base DN
 
    will be constructed by putting all elements of the sub-domain as ``dc``
 
    entries (as per standard Debian convention). I.e. ``example.com`` would get
 
    transformed into ``dc=example,dc=com``.
 

	
 
  **organization** (string, mandatory)
 
    Organization that should be specified in the base DN entry.
 

	
 
  **log_level** (string, mandatory)
 
    Log level to use for the server. This should be compatible with OpenLDAP
 
    configuration option ``olcLogLevel``. See `OpenLDAP Administrator's Guide
 
    <http://www.openldap.org/doc/admin24/slapdconf2.html#cn=config>` for value
 
    description and syntax.
 

	
 
  **tls_certificate** (string, mandatory)
 
    Path to file on Ansible host that contains the X.509 certificate used for
 
    TLS for LDAP service. The file will be copied to directory
 
    ``/etc/ssl/certs/``.
 

	
 
  **tls_key** (string, mandatory)
 
    Path to file on Ansible host that contains the private key used for TLS for
 
    LDAP service. The file will be copied to directory ``/etc/ssl/private/``.
 

	
roles/ldap_client/defaults/main.yml
Show inline comments
 
new file 100644
 
---
 

	
 
ldap_client_config: []
 
\ No newline at end of file
0 comments (0 inline, 0 general)