Skip to content

Commit b26f5ad

Browse files
author
David Coutadeur
committed
fix test of string value in when clause
1 parent 98ba742 commit b26f5ad

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tasks/ldaptoolbox-certificates.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
path: "{{ ldaptoolbox_openldap_olcTLSCACertificateFile | dirname }}"
44
state: directory
55
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 )
77

88
- name: Deploy TLS CA certificate
99
ansible.builtin.copy:
@@ -12,7 +12,7 @@
1212
owner: root
1313
group: ldap
1414
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 )
1616

1717
- name: Deploy TLS certificate
1818
ansible.builtin.copy:
@@ -21,7 +21,7 @@
2121
owner: root
2222
group: ldap
2323
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 )
2525

2626
- name: Deploy TLS key file
2727
ansible.builtin.copy:
@@ -31,7 +31,7 @@
3131
group: ldap
3232
mode: 0640
3333
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 )
3535

3636
- name: Deploy Diffie-Hellman param
3737
ansible.builtin.copy:
@@ -41,15 +41,15 @@
4141
group: ldap
4242
mode: 0640
4343
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 )
4545

4646
- name: allow ldap to read TLS certificates
4747
ansible.builtin.user:
4848
name: "{{ ldaptoolbox_openldap_configuration_owner }}"
4949
groups: "{{ ldaptoolbox_openldap_sslgroup }}"
5050
append: "yes"
5151
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 )
5353

5454
- name: Adapt ldap.conf file with CA certificate
5555
ansible.builtin.blockinfile:
@@ -59,4 +59,4 @@
5959
block: |
6060
TLS_CACERT {{ ldaptoolbox_openldap_olcTLSCACertificateFile }}
6161
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

Comments
 (0)