b55a2ee047
Signed-off-by: Hadrien Patte <hadrien.patte@protonmail.com>
43 lines
1,021 B
YAML
43 lines
1,021 B
YAML
---
|
|
# Install LDAP client packages
|
|
- name: Install LDAP client packages
|
|
apt:
|
|
name: "{{ item }}"
|
|
state: present
|
|
update_cache: true
|
|
with_items:
|
|
- nslcd
|
|
- libnss-ldapd
|
|
- libpam-ldapd
|
|
register: apt_result
|
|
retries: 3
|
|
until: apt_result is succeeded
|
|
|
|
# Reduce LDAP load
|
|
# For the moment it is broken on Stretch when using PHP7.3
|
|
# - name: Install LDAP cache package
|
|
# apt:
|
|
# name: nscd
|
|
# state: present
|
|
# update_cache: true
|
|
|
|
# Configure /etc/nslcd.conf
|
|
- name: Configure nslcd LDAP credentials
|
|
template:
|
|
src: nslcd.conf.j2
|
|
dest: /etc/nslcd.conf
|
|
mode: 0600
|
|
notify: Restart nslcd service
|
|
|
|
# Configure /etc/nsswitch.conf
|
|
- name: Configure NSS to use LDAP
|
|
lineinfile:
|
|
dest: /etc/nsswitch.conf
|
|
regexp: "^{{ item.key }}:"
|
|
line: "{{ item.value }}"
|
|
with_dict:
|
|
passwd: 'passwd: files ldap'
|
|
group: 'group: files ldap'
|
|
shadow: 'shadow: files ldap'
|
|
sudoers: 'sudoers: files ldap'
|
|
notify: Restart nslcd service
|