|
3 | 3 | path: "{{ ldaptoolbox_openldap_olcTLSCACertificateFile | dirname }}" |
4 | 4 | state: directory |
5 | 5 | mode: '0755' |
6 | | - when: ( ldaptoolbox_openldap_olcTLSCACertificateFile is defined ) and ( ldaptoolbox_openldap_olcTLSCACertificateFile ) |
| 6 | + when: ( ldaptoolbox_openldap_olcTLSCACertificateFile is defined ) and ( ldaptoolbox_openldap_olcTLSCACertificateFile | length > 0 ) |
7 | 7 |
|
8 | 8 | - name: Deploy TLS CA certificate |
9 | 9 | ansible.builtin.copy: |
|
12 | 12 | owner: root |
13 | 13 | group: ldap |
14 | 14 | mode: 0644 |
15 | | - when: ( ldaptoolbox_openldap_olcTLSCACertificateFile is defined ) and ( ldaptoolbox_openldap_olcTLSCACertificateFile ) |
| 15 | + when: ( ldaptoolbox_openldap_olcTLSCACertificateFile is defined ) and ( ldaptoolbox_openldap_olcTLSCACertificateFile | length > 0 ) |
16 | 16 |
|
17 | 17 | - name: Deploy TLS certificate |
18 | 18 | ansible.builtin.copy: |
|
21 | 21 | owner: root |
22 | 22 | group: ldap |
23 | 23 | mode: 0644 |
24 | | - when: ( ldaptoolbox_openldap_olcTLSCACertificateFile is defined ) and ( ldaptoolbox_openldap_olcTLSCACertificateFile ) |
| 24 | + when: ( ldaptoolbox_openldap_olcTLSCACertificateFile is defined ) and ( ldaptoolbox_openldap_olcTLSCACertificateFile | length > 0 ) |
25 | 25 |
|
26 | 26 | - name: Deploy TLS key file |
27 | 27 | ansible.builtin.copy: |
|
31 | 31 | group: ldap |
32 | 32 | mode: 0640 |
33 | 33 | no_log: true |
34 | | - when: ( ldaptoolbox_openldap_olcTLSCertificateKeyFile is defined ) and ( ldaptoolbox_openldap_olcTLSCertificateKeyFile ) |
| 34 | + when: ( ldaptoolbox_openldap_olcTLSCertificateKeyFile is defined ) and ( ldaptoolbox_openldap_olcTLSCertificateKeyFile | length > 0 ) |
35 | 35 |
|
36 | 36 | - name: Deploy Diffie-Hellman param |
37 | 37 | ansible.builtin.copy: |
|
41 | 41 | group: ldap |
42 | 42 | mode: 0640 |
43 | 43 | no_log: true |
44 | | - when: ( ldaptoolbox_openldap_olcTLSDHParamFile is defined ) and ( ldaptoolbox_openldap_olcTLSDHParamFile ) |
| 44 | + when: ( ldaptoolbox_openldap_olcTLSDHParamFile is defined ) and ( ldaptoolbox_openldap_olcTLSDHParamFile | length > 0 ) |
45 | 45 |
|
46 | 46 | - name: allow ldap to read TLS certificates |
47 | 47 | ansible.builtin.user: |
48 | 48 | name: "{{ ldaptoolbox_openldap_configuration_owner }}" |
49 | 49 | groups: "{{ ldaptoolbox_openldap_sslgroup }}" |
50 | 50 | append: "yes" |
51 | 51 | state: present |
52 | | - when: ( ldaptoolbox_openldap_olcTLSCertificateFile is defined ) and ( ldaptoolbox_openldap_olcTLSCertificateFile ) |
| 52 | + when: ( ldaptoolbox_openldap_olcTLSCertificateFile is defined ) and ( ldaptoolbox_openldap_olcTLSCertificateFile | length > 0 ) |
53 | 53 |
|
54 | 54 | - name: Adapt ldap.conf file with CA certificate |
55 | 55 | ansible.builtin.blockinfile: |
|
59 | 59 | block: | |
60 | 60 | TLS_CACERT {{ ldaptoolbox_openldap_olcTLSCACertificateFile }} |
61 | 61 | TLS_REQCERT demand |
62 | | - when: ( ldaptoolbox_openldap_olcTLSCACertificateFile is defined ) and ( ldaptoolbox_openldap_olcTLSCACertificateFile ) |
| 62 | + when: ( ldaptoolbox_openldap_olcTLSCACertificateFile is defined ) and ( ldaptoolbox_openldap_olcTLSCACertificateFile | length > 0 ) |
0 commit comments