Просмотр исходного кода

Make S3-mounting path configurable

This will make data migration easier.
pull/870/head
Slavi Pantaleev 5 лет назад
Родитель
Сommit
7e8e95a09a
3 измененных файлов: 7 добавлений и 6 удалений
  1. +1
    -0
      roles/matrix-synapse/defaults/main.yml
  2. +4
    -4
      roles/matrix-synapse/tasks/goofys/setup_install.yml
  3. +2
    -2
      roles/matrix-synapse/templates/goofys/systemd/matrix-goofys.service.j2

+ 1
- 0
roles/matrix-synapse/defaults/main.yml Просмотреть файл

@@ -354,6 +354,7 @@ matrix_s3_media_store_bucket_name: "your-bucket-name"
matrix_s3_media_store_aws_access_key: "your-aws-access-key"
matrix_s3_media_store_aws_secret_key: "your-aws-secret-key"
matrix_s3_media_store_region: "eu-central-1"
matrix_s3_media_store_path: "{{ matrix_synapse_media_store_path }}"

# Controls whether the self-check feature should validate SSL certificates.
matrix_synapse_self_check_validate_certificates: true


+ 4
- 4
roles/matrix-synapse/tasks/goofys/setup_install.yml Просмотреть файл

@@ -8,18 +8,18 @@
# This will throw a Permission Denied error if already mounted
- name: Check Matrix Goofys external storage mountpoint path
stat:
path: "{{ matrix_synapse_media_store_path }}"
register: local_path_matrix_synapse_media_store_path_stat
path: "{{ matrix_s3_media_store_path }}"
register: local_path_matrix_s3_media_store_path_stat
ignore_errors: yes

- name: Ensure Matrix Goofys external storage mountpoint exists
file:
path: "{{ matrix_synapse_media_store_path }}"
path: "{{ matrix_s3_media_store_path }}"
state: directory
mode: 0750
owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}"
when: "not local_path_matrix_synapse_media_store_path_stat.failed and not local_path_matrix_synapse_media_store_path_stat.stat.exists"
when: "not local_path_matrix_s3_media_store_path_stat.failed and not local_path_matrix_s3_media_store_path_stat.stat.exists"

- name: Ensure goofys environment variables file created
template:


+ 2
- 2
roles/matrix-synapse/templates/goofys/systemd/matrix-goofys.service.j2 Просмотреть файл

@@ -16,7 +16,7 @@ ExecStart={{ matrix_host_command_docker }} run --rm --name %n \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--mount type=bind,src=/etc/passwd,dst=/etc/passwd,ro \
--mount type=bind,src=/etc/group,dst=/etc/group,ro \
--mount type=bind,src={{ matrix_synapse_media_store_path }},dst=/s3,bind-propagation=shared \
--mount type=bind,src={{ matrix_s3_media_store_path }},dst=/s3,bind-propagation=shared \
--security-opt apparmor:unconfined \
--cap-add mknod \
--cap-add sys_admin \
@@ -30,7 +30,7 @@ TimeoutStartSec=5min
ExecStop=-{{ matrix_host_command_docker }} stop %n
ExecStop=-{{ matrix_host_command_docker }} kill %n
ExecStop=-{{ matrix_host_command_docker }} rm %n
ExecStop=-{{ matrix_host_command_fusermount }} -u {{ matrix_synapse_media_store_path }}
ExecStop=-{{ matrix_host_command_fusermount }} -u {{ matrix_s3_media_store_path }}
Restart=always
RestartSec=5
SyslogIdentifier=matrix-goofys


Загрузка…
Отмена
Сохранить