Add LDAP client tools
This commit is contained in:
parent
9d65590b25
commit
fd3743f293
3 changed files with 31 additions and 0 deletions
22
ldap/tasks/main.yml
Normal file
22
ldap/tasks/main.yml
Normal 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 }}"
|
6
ldap/templates/ldap.conf.j2
Normal file
6
ldap/templates/ldap.conf.j2
Normal 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
3
ldap/templates/ldaprc.j2
Normal file
|
@ -0,0 +1,3 @@
|
|||
TLS_KEY {{ tls_private }}/{{ inventory_hostname }}.key
|
||||
TLS_CERT {{ tls_certs }}/{{ inventory_hostname }}.crt
|
||||
SASL_MECH external
|
Loading…
Add table
Reference in a new issue