This commit is contained in:
Andrea Dell'Amico 2021-01-21 20:17:43 +01:00
parent 72aa28f747
commit 0a1463fdf9
1 changed files with 31 additions and 38 deletions

View File

@ -1,7 +1,8 @@
---
- block:
- name: Manage the nslcd installation and configuration
block:
- name: Install the packages required to enable the LDAP PAM authentication
apt: pkg={{ nslcd_deb_pkgs }} state=present update_cache=yes cache_valid_time=1800
apt: pkg={{ nslcd_deb_pkgs }} state=present cache_valid_time=1800
- name: Install the pam ldap configuration. We cannot use the debian tools, they are broken on ubuntu in non interactive mode
copy: src={{ item }} dest=/etc/pam.d/{{ item }}
@ -35,13 +36,5 @@
- Restart the NSCD service
tags: [ 'ldap_client', 'nslcd', 'nslcd_conf' ]
- name: Install a script that checks if the ldap authentication is working, and if not it restarts the ns(l)cd daemons
copy: src=check_ldap_users dest=/usr/local/bin/check_ldap_users owner=root group=root mode=0555
tags: [ 'smartgears', 'r_connector', 'tomcat', 'r_connector_check_ldap' ]
- name: Add a cron job that runs the ldap users check script
cron: name="check ldap users" job="/usr/local/bin/check_ldap_users" state=present user=root
tags: [ 'smartgears', 'r_connector', 'tomcat', 'r_connector_check_ldap' ]
when: nslcd_install
tags: [ 'ldap_client', 'nslcd' ]