diff --git a/defaults/main.yml b/defaults/main.yml index e2b0e47..712f7ea 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -36,7 +36,7 @@ ldaptoolbox_openldap_slapd_cli_cmd: /usr/local/openldap/sbin/slapd-cli ################################################################################ # Options -olcAttributeOptions: +ldaptoolbox_openldap_olcAttributeOptions: - lang- # Suffix diff --git a/tasks/ldaptoolbox-certificates.yml b/tasks/ldaptoolbox-certificates.yml index 6ab5039..88bde05 100644 --- a/tasks/ldaptoolbox-certificates.yml +++ b/tasks/ldaptoolbox-certificates.yml @@ -3,7 +3,7 @@ path: "{{ ldaptoolbox_openldap_olcTLSCACertificateFile | dirname }}" state: directory mode: '0755' - when: ( ldaptoolbox_openldap_olcTLSCACertificateFile ) + when: ( ldaptoolbox_openldap_olcTLSCACertificateFile is defined ) and ( ldaptoolbox_openldap_olcTLSCACertificateFile ) - name: Deploy TLS CA certificate ansible.builtin.copy: @@ -12,7 +12,7 @@ owner: root group: ldap mode: 0644 - when: ( ldaptoolbox_openldap_olcTLSCACertificateFile ) + when: ( ldaptoolbox_openldap_olcTLSCACertificateFile is defined ) and ( ldaptoolbox_openldap_olcTLSCACertificateFile ) - name: Deploy TLS certificate ansible.builtin.copy: @@ -21,7 +21,7 @@ owner: root group: ldap mode: 0644 - when: ( ldaptoolbox_openldap_olcTLSCACertificateFile ) + when: ( ldaptoolbox_openldap_olcTLSCACertificateFile is defined ) and ( ldaptoolbox_openldap_olcTLSCACertificateFile ) - name: Deploy TLS key file ansible.builtin.copy: @@ -31,7 +31,7 @@ group: ldap mode: 0640 no_log: true - when: ( ldaptoolbox_openldap_olcTLSCertificateKeyFile ) + when: ( ldaptoolbox_openldap_olcTLSCertificateKeyFile is defined ) and ( ldaptoolbox_openldap_olcTLSCertificateKeyFile ) - name: Deploy Diffie-Hellman param ansible.builtin.copy: @@ -41,14 +41,14 @@ group: ldap mode: 0640 no_log: true - when: ( ldaptoolbox_openldap_olcTLSDHParamFile ) + when: ( ldaptoolbox_openldap_olcTLSDHParamFile is defined ) and ( ldaptoolbox_openldap_olcTLSDHParamFile ) - name: allow ldap to read TLS certificates ansible.builtin.user: name: "{{ ldaptoolbox_openldap_configuration_owner }}" groups: "{{ ldaptoolbox_openldap_sslgroup }}" state: present - when: ( ldaptoolbox_openldap_olcTLSCertificateFile ) + when: ( ldaptoolbox_openldap_olcTLSCertificateFile is defined ) and ( ldaptoolbox_openldap_olcTLSCertificateFile ) - name: Adapt ldap.conf file with CA certificate ansible.builtin.blockinfile: @@ -58,4 +58,4 @@ block: | TLS_CACERT {{ ldaptoolbox_openldap_olcTLSCACertificateFile }} TLS_REQCERT demand - when: ( ldaptoolbox_openldap_olcTLSCACertificateFile ) + when: ( ldaptoolbox_openldap_olcTLSCACertificateFile is defined ) and ( ldaptoolbox_openldap_olcTLSCACertificateFile )