Skip to content

Commit

Permalink
fix ldap certificates deployment + attributeOptions variable (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Coutadeur committed Nov 21, 2024
1 parent 8f74d4a commit 8b9ab68
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ldaptoolbox_openldap_slapd_cli_cmd: /usr/local/openldap/sbin/slapd-cli
################################################################################

# Options
olcAttributeOptions:
ldaptoolbox_openldap_olcAttributeOptions:
- lang-

# Suffix
Expand Down
14 changes: 7 additions & 7 deletions tasks/ldaptoolbox-certificates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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 )

0 comments on commit 8b9ab68

Please sign in to comment.