mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-30 07:18:09 +02:00
Solved some bugs and optimized nextcloud
This commit is contained in:
31
roles/docker-nextcloud/tasks/config.yml
Normal file
31
roles/docker-nextcloud/tasks/config.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
- name: "Substitute http with https in {{ nextcloud_config_file_path }}"
|
||||
replace:
|
||||
path: "{{ nextcloud_config_file_path }}"
|
||||
regexp: "http://{{ domain | regex_escape }}"
|
||||
replace: "https://{{ domain }}"
|
||||
notify:
|
||||
- docker compose restart
|
||||
|
||||
- name: "Ensure 'overwriteprotocol' is set to 'https' in Nextcloud {{ nextcloud_config_file_path }}"
|
||||
block:
|
||||
- name: Check if 'overwriteprotocol' is already set
|
||||
lineinfile:
|
||||
path: "{{ nextcloud_config_file_path }}"
|
||||
regexp: "^\s*'overwriteprotocol'\s*=>\s*'http'"
|
||||
line: "'overwriteprotocol' => 'https',"
|
||||
backrefs: yes
|
||||
state: present
|
||||
notify:
|
||||
- docker compose restart
|
||||
|
||||
- name: Add 'overwriteprotocol' => 'https' if not present
|
||||
lineinfile:
|
||||
path: "{{ nextcloud_config_file_path }}"
|
||||
regexp: "^\s*\);$"
|
||||
line: "'overwriteprotocol' => 'https',"
|
||||
insertafter: "^\s*\);$"
|
||||
state: present
|
||||
notify:
|
||||
- docker compose restart
|
||||
notify:
|
||||
- docker compose restart
|
Reference in New Issue
Block a user