2019-02-05 08:35:45 +01:00
|
|
|
---
|
|
|
|
# Install LDAP client packages
|
|
|
|
- name: Install LDAP client packages
|
|
|
|
apt:
|
2019-03-23 19:25:04 +01:00
|
|
|
update_cache: true
|
2019-03-11 18:02:29 +01:00
|
|
|
name:
|
|
|
|
- nslcd
|
|
|
|
- libnss-ldapd
|
|
|
|
- libpam-ldapd
|
2019-08-29 07:03:05 +02:00
|
|
|
- nscd # local cache
|
2019-03-23 19:25:04 +01:00
|
|
|
state: present
|
2019-03-03 19:28:57 +01:00
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
2019-02-05 08:35:45 +01:00
|
|
|
|
|
|
|
# Configure /etc/nslcd.conf
|
|
|
|
- name: Configure nslcd LDAP credentials
|
|
|
|
template:
|
|
|
|
src: nslcd.conf.j2
|
|
|
|
dest: /etc/nslcd.conf
|
|
|
|
mode: 0600
|
2019-02-19 10:49:18 +01:00
|
|
|
notify: Restart nslcd service
|
2019-02-05 08:35:45 +01:00
|
|
|
|
|
|
|
# Configure /etc/nsswitch.conf
|
|
|
|
- name: Configure NSS to use LDAP
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/nsswitch.conf
|
2019-03-23 19:49:13 +01:00
|
|
|
regexp: "^{{ item }}:"
|
2020-11-02 17:25:38 +01:00
|
|
|
line: "{{ item }}: files ldap systemd"
|
2019-03-23 19:49:13 +01:00
|
|
|
loop:
|
|
|
|
- passwd
|
|
|
|
- group
|
|
|
|
- shadow
|
2019-02-19 10:49:18 +01:00
|
|
|
notify: Restart nslcd service
|