ansible/roles/ldap_client/tasks/install_ldap.yml

35 lines
727 B
YAML
Raw Normal View History

---
# Install LDAP client packages
- name: Install LDAP client packages
apt:
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
state: present
register: apt_result
retries: 3
until: apt_result is succeeded
# 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
# Configure /etc/nsswitch.conf
- name: Configure NSS to use LDAP
lineinfile:
dest: /etc/nsswitch.conf
regexp: "^{{ item }}:"
2020-11-02 17:25:38 +01:00
line: "{{ item }}: files ldap systemd"
loop:
- passwd
- group
- shadow
2019-02-19 10:49:18 +01:00
notify: Restart nslcd service