Changeset - 7d6c2d8f03bf
[Not reviewed]
0 2 0
Branko Majic (branko) - 9 years ago 2015-03-08 11:20:31
branko@majic.rs
MAR-1: Make sure Python LDAP bindings are installed a bit earlier. Configure TLS if certificate file and private key are available.
2 files changed with 20 insertions and 3 deletions:
0 comments (0 inline, 0 general)
roles/ldap_server/handlers/main.yml
Show inline comments
 
---
 

	
 
- name: Restart rsyslog
 
  service: name=rsyslog state=restarted
 
\ No newline at end of file
 
  service: name=rsyslog state=restarted
 

	
 
- name: Restart slapd
 
  service: name=slapd state=restarted
 
\ No newline at end of file
roles/ldap_server/tasks/main.yml
Show inline comments
 
@@ -9,6 +9,9 @@
 
- name: Install slapd
 
  apt: name=slapd state=installed
 

	
 
- name: Install Python LDAP bindings
 
  apt: name=python-ldap state=installed
 

	
 
- name: Enable slapd service
 
  service: name=slapd enabled=yes state=started
 

	
 
@@ -23,8 +26,19 @@
 
- name: Change log level for slapd
 
  ldap_entry: dn=cn=config state=replaceattributes olcLogLevel="{{ ldap_server_config.log_level }}"
 

	
 
- name: Install Python LDAP bindings
 
  apt: name=python-ldap state=installed
 
- name: Check if TLS private key is available
 
  stat: path="{{ ldap_server_config.tls_key }}"
 
  register: tls_key
 

	
 
- name: Check if TLS certificate is available
 
  stat: path="{{ ldap_server_config.tls_key }}"
 
  register: tls_certificate
 

	
 
- name: Configure TLS for slapd
 
  ldap_entry: dn=cn=config state=replaceattributes olcTLSCertificateFile="{{ ldap_server_config.tls_certificate }}" olcTLSCertificateKeyFile="{{ ldap_server_config.tls_key }}"
 
  when: tls_key.stat.exists and tls_certificate.stat.exists
 
  notify:
 
    - Restart slapd
 

	
 
- name: Apply database permissions
 
  ldap_permissions:
0 comments (0 inline, 0 general)