2021-04-29 13:12:28 +00:00
|
|
|
---
|
|
|
|
- name: Install slapd
|
|
|
|
apt:
|
|
|
|
update_cache: true
|
|
|
|
name:
|
|
|
|
- slapd
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
|
|
|
|
|
|
|
- name: Remove slapd config directory
|
|
|
|
file:
|
|
|
|
path: /etc/ldap/slapd.d/
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: Deploy slapd configuration
|
|
|
|
template:
|
|
|
|
src: "ldap/{{ item.dest }}.j2"
|
|
|
|
dest: "/etc/ldap/{{ item.dest }}"
|
|
|
|
mode: "{{ item.mode }}"
|
|
|
|
owner: openldap
|
|
|
|
group: openldap
|
|
|
|
loop:
|
|
|
|
- { dest: slapd.conf, mode: "0600" }
|
2021-05-24 16:31:43 +00:00
|
|
|
#- { dest: ldap.key, mode: "0600" }
|
|
|
|
#- { dest: ldap.pem, mode: "0644" }
|
2021-04-29 13:12:28 +00:00
|
|
|
notify: Restart slapd
|
|
|
|
|
|
|
|
- name: Deploy ldap services
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/default/slapd
|
|
|
|
regexp: '^SLAPD_SERVICES='
|
|
|
|
line: 'SLAPD_SERVICES="ldaps://{{ slapd.ip }}/ ldapi:///"'
|
|
|
|
notify: Restart slapd
|
|
|
|
check_mode: no
|