Commit c37ad49b authored by nimrod's avatar nimrod
Browse files

- Use Ansible modules from ansible-modules repo, so instead of generating a ldif

  file and running ldapadd/ ldapmodify, use an Ansible module instead.
parent e72d583a
Loading
Loading
Loading
Loading
+12 −12
Changes for tasks/main.yml: 12 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
    - ldap-utils
    - slapd
    - gnutls-bin
    - python-ldap

- name: Allow slapd to access the TLS key
  user:
@@ -62,18 +63,17 @@
    regexp: '^URI'
    state: present

- name: Generate LDAPS configuration
  template:
    src: ldaps.ldif.j2
    dest: /root/ldaps.ldif
    owner: root
    group: root
    mode: '0644'
  register: ldaps_template

- name: Apply LDAPS Configuration
  when: ldaps_template.changed
  command: /usr/bin/ldapmodify -v -d1 -Y EXTERNAL -f /root/ldaps.ldif
- name: Configure olcTLS attributes
  with_dict:
    olcTLSCACertificateFile: '{{ tls_ca_cert_path }}'
    olcTLSCertificateKeyFile: '{{ tls_key_path }}'
    olcTLSCertificateFile: '{{ tls_cert_path }}'
    olcTLSCipherSuite: '+AES-128-GCM:+AES-256-GCM:+AES-128-CBC:+AES-256-CBC:+ECDHE-RSA:+DHE-RSA:+AEAD:+SHA1:+SHA256:+SHA384'
  ldap_attr:
    dn: 'cn=config'
    name: '{{ item.key }}'
    values: '{{ item.value }}'
    state: exact
  notify:
    - Restart OpenLDAP

−14

File deleted.