Skip to content

Commit

Permalink
update ansible role for compatibility with OpenLDAP 2.5 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Coutadeur committed Dec 3, 2024
1 parent 871776b commit 6ba80c4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ If you want the certificates to be deployed by ansible, you can enable it by add
ldaptoolbox_openldap_deploy_certificates: true
```

You can also configure the OpenLDAP version to install. Currently, only 2.5 and 2.6 are supported. The default is 2.6. You can change this in your playbook with:

```
ldaptoolbox_openldap_version: "2.5"
```


Give a look at `playbook/group_vars/prod.yml`, `playbook/host_vars/master1.yml` and `playbook/host_vars/master2.yml` for variable customization
You can also use `--extra-vars variable=value` at the command line for overloading any variable.
Expand Down
5 changes: 4 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# Defaults variables for OpenLDAP role
################################################################################

# default OpenLDAP version
ldaptoolbox_openldap_version: "2.6"

# Deploy certificate
ldaptoolbox_openldap_deploy_certificates: false

Expand All @@ -12,7 +15,7 @@ ldaptoolbox_openldap_apt_key_url: "https://ltb-project.org/documentation/_static
ldaptoolbox_openldap_apt_key_id: "3FC3FD92ABA3975D2BEB95A70AC51F926D45BFC5"
ldaptoolbox_openldap_apt_repo_filename: "ltb-project-openldap"
ldaptoolbox_openldap_apt_keyrings_path: /usr/share/keyrings
ldaptoolbox_openldap_apt_repo: "deb [arch=amd64 signed-by=/usr/share/keyrings/ltb-project-openldap.gpg] http://ltb-project.org/debian/openldap26/bookworm bookworm main"
ldaptoolbox_openldap_apt_repo: "deb [arch=amd64 signed-by=/usr/share/keyrings/ltb-project-openldap.gpg] http://ltb-project.org/debian/openldap{{ '25' if ldaptoolbox_openldap_version == '2.5' else '26' }}/bookworm bookworm main"
ldaptoolbox_openldap_apt_validate_certs: "true"

# Packages
Expand Down
2 changes: 1 addition & 1 deletion tasks/ldaptoolbox-repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
content: |
[ltb-project]
name=LTB project packages
baseurl=https://ltb-project.org/rpm/openldap26/$releasever/$basearch
baseurl=https://ltb-project.org/rpm/openldap{{ '25' if ldaptoolbox_openldap_version == '2.5' else '26' }}/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-LTB-project-security
Expand Down
3 changes: 3 additions & 0 deletions templates/var/backups/openldap/config.ldif
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ olcIndexHash64: FALSE
olcIndexIntLen: 4
olcListenerThreads: 1
olcLocalSSF: 71
{% if ldaptoolbox_openldap_version == '2.5' %}
{% else %}
olcLogFile: {{ ldaptoolbox_openldap_olcLogFile }}
olcLogFileOnly: TRUE
olcLogFileRotate: {{ ldaptoolbox_openldap_olcLogFileRotate }}
{% endif %}
olcLogLevel: {{ ldaptoolbox_openldap_olcLogLevel }}
olcMaxFilterDepth: 1000
olcPidFile: /usr/local/openldap/var/run/slapd.pid
Expand Down

0 comments on commit 6ba80c4

Please sign in to comment.