Commit e30660cc authored by Chris Croome's avatar Chris Croome

Various updates for #14

parent ef13a409
Pipeline #6306 passed with stage
in 26 seconds
......@@ -31,6 +31,10 @@
msg: "The results of pulling the collabora image : {{ collabora_pull }}"
verbosity: 1
- name: Check if the Collabora container is running
shell: docker ps | grep collabora | awk '{ print $1 }'
register: nextcloud_collabora_docker_container_check
- block:
- name: Stop and remove the Collabora image
......@@ -39,7 +43,7 @@
state: absent
- debug:
msg: "Escaped hostname: {{ hostname | regex_replace('\\.', '\\.') }}"
msg: "Escaped hostname: {{ inventory_hostname | regex_replace('\\.', '\\.') }}"
verbosity: 1
- name: Pause before starting Collabora container
......@@ -62,6 +66,7 @@
- name: Manually check if there is a Docker container listening on port 9980
shell: fuser 9980/tcp | grep 9980
register: nextcloud_collabora_docker_port
ignore_errors: true
- name: Get the running container ID
shell: docker ps | grep -v ^CONTAINER | awk '{ print $1 }'
......@@ -88,11 +93,11 @@
ports:
- "127.0.0.1:9980:9980"
env:
domain: "{{ hostname | regex_replace('\\.', '\\.') }}"
domain: "{{ inventory_hostname | regex_replace('\\.', '\\.') }}"
dictionaries: "en_GB en_US es_ES fr_FR de_DE"
capabilities: MKNOD
when: collabora_pull.changed
when: ( collabora_pull.changed ) or ( nextcloud_collabora_docker_container_check.stdout == "" )
- name: Apache modules configured
apache2_module:
......
......@@ -11,6 +11,14 @@
- fail2ban
state: present
- name: Check the hostname
command: hostname -f
register: nextcloud_hostname_check
- name: Set the hostname
command: "hostname {{ inventory_hostname }}"
when: nextcloud_hostname_check.stdout != inventory_hostname
- block:
- name: Apache Nextcloud VirtualHost in place
......
......@@ -114,6 +114,7 @@
- name: Add each subjectAltName as a Nextcloud trusted_domain
include_tasks: trusted_domains.yml
with_items:
- "{{ common_name }}"
- "{{ subject_alt_names }}"
# https://docs.nextcloud.com/server/12/admin_manual/configuration_server/occ_command.html#setting-an-array-configuration-value
......@@ -136,6 +137,43 @@
# chdir: /var/www/nextcloud
# when: hostname_ip.stdout == www_hostname_dig_ip.stdout
# https://docs.nextcloud.com/server/15/go.php?to=admin-mysql-utf8mb4
- name: Enabling MySQL 4-byte support
command: mysql nextcloud --batch -e "ALTER DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"
- name: Set mysql.utf8mb4 config to true in config.php
shell: php occ config:system:set mysql.utf8mb4 --type boolean --value="true"
args:
chdir: /var/www/nextcloud
executable: /bin/bash
become: true
become_user: www-data
- name: Convert all existing tables to the new collation by running the repair step
shell: php occ maintenance:repair
args:
chdir: /var/www/nextcloud
executable: /bin/bash
become: true
become_user: www-data
# https://docs.nextcloud.com/server/15/admin_manual/configuration_database/bigint_identifiers.html
- name: BigInt (64bit) identifiers on the filecache table
shell: php occ db:convert-filecache-bigint
args:
chdir: /var/www/nextcloud
executable: /bin/bash
become: true
become_user: www-data
- name: BigInt (64bit) identifiers on the activity table
shell: php occ db:convert-filecache-bigint --no-interaction
args:
chdir: /var/www/nextcloud
executable: /bin/bash
become: true
become_user: www-data
# https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#pretty-urls
- name: Remove index.php from URLs
shell: 'php occ config:system:set overwrite.cli.url --value="https://{{ common_name }}/"'
......@@ -193,7 +231,7 @@
become: true
become_user: www-data
- name: Set the mail_domain to {{ hostname }}
- name: "Set the mail_domain to {{ hostname }}"
shell: 'php occ config:system:set mail_domain --value="{{ hostname }}"'
args:
chdir: /var/www/nextcloud
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment