Add LDAP client tools

This commit is contained in:
Timo Makinen 2021-06-25 15:54:49 +00:00
parent 9d65590b25
commit fd3743f293
3 changed files with 31 additions and 0 deletions

22
ldap/tasks/main.yml Normal file
View file

@ -0,0 +1,22 @@
---
- name: install packages
package:
name: openldap-clients
state: installed
- name: configure ldap client
template:
dest: /etc/openldap/ldap.conf
src: ldap.conf.j2
mode: 0644
owner: root
group: "{{ ansible_wheel }}"
- name: authenticate to ldap with host certs when running as root
template:
dest: /root/.ldaprc
src: ldaprc.j2
mode: 0600
owner: root
group: "{{ ansible_wheel }}"

View file

@ -0,0 +1,6 @@
BASE {{ ldap_basedn }}
URI {% for item in ldap_server %}ldaps://{{ item }} {% endfor %}
TLS_CACERT {{ tls_bundle }}
TLS_REQCERT demand

3
ldap/templates/ldaprc.j2 Normal file
View file

@ -0,0 +1,3 @@
TLS_KEY {{ tls_private }}/{{ inventory_hostname }}.key
TLS_CERT {{ tls_certs }}/{{ inventory_hostname }}.crt
SASL_MECH external