mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +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
|
@@ -6,18 +6,12 @@
|
||||
- name: "include role for {{application_id}} to recieve certs & do modification routines"
|
||||
include_role:
|
||||
name: nginx-https-get-cert-modify-all
|
||||
vars:
|
||||
domain: "{{domains[application_id]}}"
|
||||
http: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: create nextcloud nginx proxy configuration file
|
||||
template:
|
||||
src: "proxy-nginx.conf.j2"
|
||||
dest: "{{nginx.directories.http.servers}}{{domains[application_id]}}.conf"
|
||||
notify: restart nginx
|
||||
vars:
|
||||
domain: "{{domains[application_id]}}"
|
||||
http_port: "{{ports.localhost.http[application_id]}}"
|
||||
|
||||
- name: create internal nextcloud nginx configuration
|
||||
template:
|
||||
@@ -34,4 +28,7 @@
|
||||
|
||||
- name: Include LDAP specific tasks
|
||||
include_tasks: ldap.yml
|
||||
when: applications[application_id].ldap_enabled | bool
|
||||
when: applications[application_id].ldap_enabled | bool
|
||||
|
||||
- name: Include Config specific tasks
|
||||
include_tasks: config.yml
|
Reference in New Issue
Block a user