fixed permission issue with cert

This commit is contained in:
Ebbe Baß
2026-07-17 08:34:37 +02:00
parent 1be2b87a2e
commit 1ec4345e43
@@ -118,7 +118,13 @@
-out {{ cc_ssl_cert }} -out {{ cc_ssl_cert }}
-subj "/CN={{ collabora_code_domain }}/O=Office/C=DE" -subj "/CN={{ collabora_code_domain }}/O=Office/C=DE"
-addext "subjectAltName=DNS:{{ collabora_code_domain }}" -addext "subjectAltName=DNS:{{ collabora_code_domain }}"
creates: "{{ cc_ssl_cert }}" # IMPORTANT: guard on the KEY, not the cert. openssl req writes both
# files in one command, but if a previous run died/was interrupted
# after writing the .crt and before (or while) writing the .key,
# a `creates` check on the .crt alone causes Ansible to skip
# regenerating the pair on every subsequent run - leaving a cert
# with no matching (or unreadable/empty) key on disk.
creates: "{{ cc_ssl_key }}"
- name: Restrict private key permissions - name: Restrict private key permissions
ansible.builtin.file: ansible.builtin.file:
@@ -166,7 +172,6 @@
ProxyPreserveHost On ProxyPreserveHost On
# cert is issued for collaboraonline.example.com and we proxy to localhost # cert is issued for collaboraonline.example.com and we proxy to localhost
SSLProxyVerify None SSLProxyVerify None
SSLProxyCheckPeerCN Off SSLProxyCheckPeerCN Off
@@ -223,6 +228,11 @@
args: args:
creates: /etc/apache2/sites-enabled/collabora.conf creates: /etc/apache2/sites-enabled/collabora.conf
- name: Validate Apache configuration before restart
ansible.builtin.command: apache2ctl configtest
register: apache_configtest
changed_when: false
- name: Restart Apache to apply changes - name: Restart Apache to apply changes
ansible.builtin.service: ansible.builtin.service:
name: apache2 name: apache2