3
0
mirror of https://github.com/spantaleev/matrix-docker-ansible-deploy.git synced 2025-12-13 20:42:39 +00:00

Move media_store & logs out of /data. Allow logging to be configured

The goal is to allow these to be on separate partitions
(including remote ones in the future).

Because the `silviof/docker-matrix` image chowns
everything to MATRIX_UID:MATRIX_GID on startup,
we definitely don't want to include `media_store` in it.
If it's on a remote FS, it would cause a slow startup.

Also, adding some safety checks to the "import media store"
task, after passing a wrong path to it on multiple occassions and
wondering what's wrong.

Also, making logging configurable. The default of keeping 10x100MB
log files is likely excessive and people may want to change that.
This commit is contained in:
Slavi Pantaleev
2017-09-07 12:12:31 +03:00
parent 2bb8bb96d4
commit ea91ef7fb2
5 changed files with 72 additions and 45 deletions

View File

@@ -14,6 +14,22 @@
fail: msg="File cannot be found on the local machine at {{ local_path_media_store }}"
when: "not local_path_media_store_stat.stat.exists or not local_path_media_store_stat.stat.isdir"
- name: Check if media store contains local_content
stat: path="{{ local_path_media_store }}/local_content"
delegate_to: 127.0.0.1
become: false
register: local_path_media_store_local_content_stat
- name: Check if media store contains remote_content
stat: path="{{ local_path_media_store }}/remote_content"
delegate_to: 127.0.0.1
become: false
register: local_path_media_store_remote_content_stat
- name: Fail if media_store directory doesn't look okay (lacking remote and local content)
fail: msg="{{ local_path_media_store }} contains neither local_content nor remote_content. It's most likely a mistake and is not a media store directory."
when: "not local_path_media_store_local_content_stat.stat.exists and not local_path_media_store_remote_content_stat.stat.exists"
- name: Ensure matrix-synapse is stopped
service: name=matrix-synapse state=stopped daemon_reload=yes
register: stopping_result
@@ -21,7 +37,7 @@
- name: Ensure provided media_store directory is copied to the server
synchronize:
src: "{{ local_path_media_store }}/"
dest: "{{ matrix_synapse_data_path }}/media_store"
dest: "{{ matrix_synapse_media_store_path }}"
delete: yes
- name: Ensure Matrix Synapse is started (if it previously was)