Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LDAP integration #5

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,15 @@ sympa_soap_nginx_snippet: |
sympa_install_odbc_driver: false

sympa_rsyslog_unix_user: "{{ sympa_unix_user }}"

sympa_config_ldap_enabled: true
sympa_config_ldap:
host: "192.168.56.5"
base_dn: "dc=realm,dc=example,dc=com"
bind_dn: uid=bin,cn=sysaccounts,cn=etc,dc=realm,dc=example,dc=com
bind_password: password
email_attribute: mail
use_tls: ldaps
get_dn_by_uid_filter: (uid=[sender])
get_dn_by_email_filter: (mail=[sender])
authentication_info_url: https://portal.example.de
1 change: 1 addition & 0 deletions osvars/Alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ sympa_gettext_package: gettext-dev
sympa_openssldev_package: libressl-dev
sympa_expatdev_package: expat-dev
sympa_zlibdev_package: zlib-dev
sympa_ldap_package: perl-ldap
1 change: 1 addition & 0 deletions osvars/Archlinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ sympa_openssldev_package: openssl
sympa_expatdev_package: expat
sympa_xml2dev_package: libxml2
sympa_zlibdev_package: zlib
sympa_ldap_package: perl-ldap
1 change: 1 addition & 0 deletions osvars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ sympa_gettext_package: gettext
sympa_openssldev_package: libssl-dev
sympa_expatdev_package: libexpat1-dev
sympa_xml2dev_package: libxml2-dev
sympa_ldap_package: libnet-ldap-perl
sympa_zlibdev_package: zlib1g-dev

sympa_package_command: /usr/bin/sympa
Expand Down
1 change: 1 addition & 0 deletions osvars/FreeBSD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ sympa_cpanm_program: /usr/local/bin/cpanm
sympa_make_package: gmake
sympa_expatdev_package: expat
sympa_zlibdev_package: zlib
sympa_ldap_package: p5-perl-ldap
1 change: 1 addition & 0 deletions osvars/Gentoo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ sympa_cpanm_package: dev-perl/App-cpanminus
sympa_openssldev_package: libressl-dev
sympa_expatdev_package: expat-dev
sympa_zlibdev_package: zlib-dev
sympa_ldap_package: dev-perl/perl-ldap
1 change: 1 addition & 0 deletions osvars/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ sympa_openssldev_package: openssl-devel
sympa_expatdev_package: expat-devel
sympa_xml2dev_package: libxml2-devel
sympa_zlibdev_package: zlib-devel
sympa_ldap_package: perl-LDAP

sympa_package_command: /usr/sbin/sympa.pl
sympa_package_bin_directory: /usr/sbin
Expand Down
1 change: 1 addition & 0 deletions osvars/SLES.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ sympa_web_unix_user: nginx

sympa_cpanm_package: perl-App-cpanminus
sympa_openssldev_package: libopenssl-devel
sympa_ldap_package: perl-ldap
1 change: 1 addition & 0 deletions osvars/Suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ sympa_cpanm_package: perl-App-cpanminus
sympa_openssldev_package: libopenssl-devel
sympa_expatdev_package: libexpat-devel
sympa_zlibdev_package: zlib-devel
sympa_ldap_package: perl-ldap
1 change: 1 addition & 0 deletions osvars/Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ sympa_cpanm_package: cpanminus
sympa_openssldev_package: libssl-dev
sympa_expatdev_package: libexpat1-dev
sympa_xml2dev_package: libxml2-dev
sympa_ldap_package: libnet-ldap-perl
sympa_zlibdev_package: zlib1g-dev

sympa_rsyslog_unix_user: syslog
Expand Down
4 changes: 4 additions & 0 deletions tasks/perl-modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
package:
name: "{{ sympa_xml2dev_package }}"

- name: Install LDAP library
package:
name: "{{ sympa_ldap_package }}"

- name: Workaround for XML::LibXML installation problem on CentOS 7
package:
name: perl-XML-LibXML
Expand Down
18 changes: 18 additions & 0 deletions templates/auth.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,21 @@
user_table
regexp .*
{% endif %}

# LDAP
{% if sympa_config_ldap is defined %}
ldap
host {{ sympa_config_ldap.host}}
timeout {{ sympa_config_ldap.timeout | default('20') }}
bind_dn {{ sympa_config_ldap.bind_dn }}
bind_password {{ sympa_config_ldap.bind_password }}
suffix {{ sympa_config_ldap.base_dn }}
get_dn_by_uid_filter {{ sympa_config_ldap.get_dn_by_uid_filter }}
get_dn_by_email_filter {{ sympa_config_ldap.get_dn_by_email_filter }}
alternative_email_attribute {{ sympa_config_ldap.alternative_email_attribute | default('mail') }}
email_attribute {{ sympa_config_ldap.email_attribute | default('mail') }}
scope {{ sympa_config_ldap.scope | default('sub') }}
authentication_info_url {{ sympa_config_ldap.authentication_info_url }}
use_tls {{ sympa_config_ldap.use_tls }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please set the default to "ldaps".

ca_verify {{ sympa_config_ldap.ca_verify | default('none') }}
{% endif %}