Changeset - 5a36f75bc297
[Not reviewed]
0 7 0
Branko Majic (branko) - 4 years ago 2020-10-01 23:37:28
branko@majic.rs
MAR-161: Make the ldap_server_domain parameter in the ldap_server role mandatory:

- Updated the ldap_server role.
- Removed default value for the parameter.
- Updated tests.
- Updated role reference documentation.
- Updated release notes.
- Dropped the .local from the Molecule instance names.
7 files changed with 13 insertions and 10 deletions:
0 comments (0 inline, 0 general)
docs/releasenotes.rst
Show inline comments
 
@@ -35,6 +35,8 @@ Breaking changes:
 

	
 
* ``ldap_server`` role
 

	
 
  * Parameter ``ldap_server_domain`` is now mandatory.
 

	
 
  * Updated default set of TLS ciphers used by server
 
    (``ldap_tls_ciphers`` parameter). All CBC ciphers have been
 
    dropped. This could introduce incompatibility with older clients
docs/rolereference.rst
Show inline comments
 
@@ -714,11 +714,11 @@ Parameters
 
  - **state** (state of the group, optional, defaults to ``present``, this
 
    should be ``present`` or ``absent``, allowing for removal of old groups)
 

	
 
**ldap_server_domain** (string, optional, ``{{ ansible_domain }}``)
 
**ldap_server_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
 
  entries (as per standard Debian convention). E.g. ``example.com`` would get
 
  transformed into ``dc=example,dc=com``.
 

	
 
**ldap_server_organization** (string, optional, ``Private``)
roles/ldap_server/defaults/main.yml
Show inline comments
 
@@ -2,7 +2,6 @@
 

	
 
enable_backup: false
 
ldap_entries: []
 
ldap_server_domain: "{{ ansible_domain }}"
 
# Internal value, base DN.
 
ldap_server_int_basedn: "{{ ldap_server_domain | regex_replace('\\.', ',dc=') | regex_replace('^', 'dc=') }}"
 
ldap_server_organization: "Private"
roles/ldap_server/molecule/default/group_vars/parameters-mandatory.yml
Show inline comments
 
@@ -2,6 +2,8 @@
 

	
 
ldap_admin_password: adminpassword
 

	
 
ldap_server_domain: "local"
 

	
 
ldap_server_tls_certificate: "{{ lookup('file', 'tests/data/x509/server/{{ inventory_hostname }}_ldap.cert.pem') }}"
 
ldap_server_tls_key: "{{ lookup('file', 'tests/data/x509/server/{{ inventory_hostname }}_ldap.key.pem') }}"
 

	
roles/ldap_server/molecule/default/molecule.yml
Show inline comments
 
@@ -24,7 +24,7 @@ platforms:
 
        network_name: private_network
 
        type: static
 

	
 
  - name: parameters-mandatory-stretch64.local
 
  - name: parameters-mandatory-stretch64
 
    groups:
 
      - parameters-mandatory
 
    box: debian/contrib-stretch64
roles/ldap_server/molecule/default/prepare.yml
Show inline comments
 
@@ -23,8 +23,8 @@
 
          - "{{ item.name }}"
 
          - "{{ item.fqdn }}"
 
      with_items:
 
        - name: parameters-mandatory-stretch64.local_ldap
 
          fqdn: parameters-mandatory.local
 
        - name: parameters-mandatory-stretch64_ldap
 
          fqdn: parameters-mandatory
 
        - name: parameters-optional-stretch64_ldap
 
          fqdn: parameters-optional
 

	
 
@@ -79,7 +79,7 @@
 
        mode: 0644
 
        state: present
 
      with_dict:
 
        10.31.127.22: parameters-mandatory-stretch64.local
 
        10.31.127.22: parameters-mandatory-stretch64
 
        10.31.127.23: parameters-optional-stretch64
 

	
 
- hosts: parameters-optional
 
@@ -112,7 +112,7 @@
 
        mode: 0644
 
        state: present
 
      with_dict:
 
        127.0.2.1: parameters-mandatory.local
 
        127.0.2.1: parameters-mandatory
 

	
 
- hosts: backup-server
 
  become: true
roles/ldap_server/molecule/default/tests/test_mandatory.py
Show inline comments
 
@@ -59,11 +59,11 @@ def test_tls_connectivity(host):
 
    STARTTLS/TLS.
 
    """
 

	
 
    starttls = host.run('ldapwhoami -Z -x -H ldap://parameters-mandatory.local/')
 
    starttls = host.run('ldapwhoami -Z -x -H ldap://parameters-mandatory/')
 
    assert starttls.rc == 0
 
    assert starttls.stdout == 'anonymous\n'
 

	
 
    tls = host.run('ldapwhoami -x -H ldaps://parameters-mandatory.local/')
 
    tls = host.run('ldapwhoami -x -H ldaps://parameters-mandatory/')
 
    assert tls.rc == 0
 
    assert tls.stdout == 'anonymous\n'
 

	
0 comments (0 inline, 0 general)