Changeset - c3861b9a54bb
[Not reviewed]
0 5 0
Branko Majic (branko) - 2 months ago 2024-02-27 18:19:02
branko@majic.rs
MAR-192: Added support for Debian 12 Bookworm to ldap_server role.
5 files changed with 40 insertions and 2 deletions:
0 comments (0 inline, 0 general)
docs/rolereference.rst
Show inline comments
 
@@ -790,12 +790,13 @@ Parameters
 
Distribution compatibility
 
~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
Role is compatible with the following distributions:
 

	
 
- Debian 11 (Bullseye)
 
- Debian 12 (Bookworm)
 

	
 

	
 
Examples
 
~~~~~~~~
 

	
 
Here is an example configuration for setting-up LDAP server:
roles/ldap_server/meta/main.yml
Show inline comments
 
@@ -15,6 +15,7 @@ galaxy_info:
 
  license: BSD
 
  min_ansible_version: 2.9
 
  platforms:
 
    - name: Debian
 
      versions:
 
        - 11
 
        - 12
roles/ldap_server/molecule/default/molecule.yml
Show inline comments
 
@@ -12,13 +12,13 @@ lint:
 
  options:
 
    config-file: ../../.yamllint.yml
 

	
 
platforms:
 

	
 
  - name: client
 
    box: debian/bullseye64
 
    box: debian/bookworm64
 
    memory: 512
 
    cpus: 1
 
    provider_raw_config_args:
 
      - "customize ['modifyvm', :id, '--paravirtprovider', 'minimal']"
 
    interfaces:
 
      - auto_config: true
 
@@ -52,12 +52,41 @@ platforms:
 
    interfaces:
 
      - auto_config: true
 
        ip: 192.168.56.32
 
        network_name: private_network
 
        type: static
 

	
 
  - name: parameters-mandatory-bookworm
 
    groups:
 
      - parameters-mandatory
 
    box: debian/bookworm64
 
    memory: 384
 
    cpus: 1
 
    provider_raw_config_args:
 
      - "customize ['modifyvm', :id, '--paravirtprovider', 'minimal']"
 
    interfaces:
 
      - auto_config: true
 
        ip: 192.168.56.21
 
        network_name: private_network
 
        type: static
 

	
 
  - name: parameters-optional-bookworm
 
    groups:
 
      - parameters-optional
 
      - backup-server
 
    box: debian/bookworm64
 
    memory: 384
 
    cpus: 1
 
    provider_raw_config_args:
 
      - "customize ['modifyvm', :id, '--paravirtprovider', 'minimal']"
 
    interfaces:
 
      - auto_config: true
 
        ip: 192.168.56.22
 
        network_name: private_network
 
        type: static
 

	
 
provisioner:
 
  name: ansible
 
  playbooks:
 
    cleanup: cleanup.yml
 
  config_options:
 
    defaults:
roles/ldap_server/molecule/default/prepare.yml
Show inline comments
 
@@ -24,12 +24,16 @@
 
          - "{{ item.fqdn }}"
 
      with_items:
 
        - name: parameters-mandatory-bullseye_ldap
 
          fqdn: parameters-mandatory
 
        - name: parameters-optional-bullseye_ldap
 
          fqdn: parameters-optional
 
        - name: parameters-mandatory-bookworm_ldap
 
          fqdn: parameters-mandatory
 
        - name: parameters-optional-bookworm_ldap
 
          fqdn: parameters-optional
 

	
 
    - name: Set-up link to generated X.509 material
 
      file:
 
        src: ".gimmecert"
 
        dest: "tests/data/x509"
 
        state: link
 
@@ -78,12 +82,14 @@
 
        group: root
 
        mode: 0644
 
        state: present
 
      with_dict:
 
        192.168.56.31: parameters-mandatory-bullseye
 
        192.168.56.32: parameters-optional-bullseye
 
        192.168.56.21: parameters-mandatory-bookworm
 
        192.168.56.22: parameters-optional-bookworm
 

	
 
- hosts: parameters-optional
 
  become: true
 
  tasks:
 

	
 
    - name: Set-up the hosts file
roles/ldap_server/molecule/default/tests/test_mandatory.py
Show inline comments
 
@@ -125,13 +125,14 @@ def test_permissions(host):
 
    Tests if LDAP directory permissions have been set-up correctly.
 
    """
 

	
 
    with host.sudo():
 
        permissions = host.run("ldapsearch -o ldif-wrap=no -H ldapi:/// -Q -LLL -Y EXTERNAL -b 'olcDatabase={1}mdb,cn=config' -s base olcAccess olcAccess")
 

	
 
        expected_permissions = """olcAccess: {0}to * by dn.exact=gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth manage by dn="cn=admin,dc=local" manage by * break
 
        expected_permissions = \
 
            """olcAccess: {0}to * by dn.exact=gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth manage by dn="cn=admin,dc=local" manage by * break
 
olcAccess: {1}to attrs=userPassword,shadowLastChange by self write by anonymous auth by * none
 
olcAccess: {2}to dn.base="" by * read
 
olcAccess: {3}to * by self write by dn="cn=admin,dc=local" write by users read by * none"""
 

	
 
        assert permissions.rc == 0
 
        assert expected_permissions in permissions.stdout
0 comments (0 inline, 0 general)