2016-04-15 20:33:23 +02:00
|
|
|
---
|
|
|
|
- name: Install a script that fix the letsencrypt certificates for openldap and then reload the service
|
2016-04-20 15:21:19 +02:00
|
|
|
copy: src=openldap-letsencrypt-acme.sh dest={{ letsencrypt_acme_services_scripts_dir }}/openldap owner=root group=root mode=4555
|
2016-04-15 20:33:23 +02:00
|
|
|
when:
|
|
|
|
- openldap_letsencrypt_managed
|
|
|
|
- letsencrypt_acme_install
|
2018-03-01 18:07:57 +01:00
|
|
|
register: openldap_letsencrypt_hook
|
2016-04-15 20:33:23 +02:00
|
|
|
tags: [ 'ldap_server', 'ldap', 'ldap_conf', 'letsencrypt' ]
|
|
|
|
|
|
|
|
- name: Copy the SSL ldif on the ldap server
|
2018-03-01 18:07:57 +01:00
|
|
|
copy: src=olcSSL.ldif dest=/etc/ldap/schema/olcSSL.ldif
|
2016-04-15 20:33:23 +02:00
|
|
|
when:
|
|
|
|
- openldap_letsencrypt_managed
|
|
|
|
- letsencrypt_acme_install
|
|
|
|
tags: [ 'ldap_server', 'ldap', 'ldap_conf', 'letsencrypt' ]
|
|
|
|
|
2018-03-01 18:07:57 +01:00
|
|
|
- name: Run the letsencrypt hook una tantum to create the correct environment
|
|
|
|
shell: '{{ letsencrypt_acme_services_scripts_dir }}/openldap'
|
|
|
|
when: openldap_letsencrypt_hook is changed
|
|
|
|
tags: [ 'ldap_server', 'ldap', 'ldap_conf', 'letsencrypt' ]
|
|
|
|
|
2016-04-15 20:33:23 +02:00
|
|
|
- name: Enable the openldap ssl configuration
|
2018-03-01 18:07:57 +01:00
|
|
|
shell: ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/olcSSL.ldif ; touch /etc/ldap/schema/.olcSSL.ldif.installed
|
2016-04-15 20:33:23 +02:00
|
|
|
args:
|
2018-03-01 18:07:57 +01:00
|
|
|
creates: /etc/ldap/schema/.olcSSL.ldif.installed
|
2016-04-15 20:33:23 +02:00
|
|
|
notify: Restart openldap
|
2016-04-20 15:21:19 +02:00
|
|
|
when:
|
|
|
|
- openldap_letsencrypt_managed
|
|
|
|
- letsencrypt_acme_install
|
2016-04-15 20:33:23 +02:00
|
|
|
tags: [ 'ldap_server', 'ldap', 'ldap_conf', 'letsencrypt' ]
|
|
|
|
|