From 735e7355a506c6be384e27b9944d1db649cbf7da Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sun, 27 Nov 2022 09:28:29 +0200 Subject: [PATCH] Rename variable (matrix_synapse_ext_s3_storage_provider_path -> matrix_synapse_ext_s3_storage_provider_base_path) --- roles/custom/matrix-synapse/defaults/main.yml | 7 +++++-- .../tasks/ext/s3-storage-provider/setup_install.yml | 6 +++--- .../tasks/ext/s3-storage-provider/setup_uninstall.yml | 2 +- roles/custom/matrix-synapse/tasks/setup_install.yml | 2 +- roles/custom/matrix-synapse/tasks/validate_config.yml | 1 + .../matrix-synapse-s3-storage-provider-migrate.j2 | 4 ++-- .../matrix-synapse-s3-storage-provider-shell.j2 | 4 ++-- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/roles/custom/matrix-synapse/defaults/main.yml b/roles/custom/matrix-synapse/defaults/main.yml index d643400c..c1f6b99a 100644 --- a/roles/custom/matrix-synapse/defaults/main.yml +++ b/roles/custom/matrix-synapse/defaults/main.yml @@ -49,14 +49,17 @@ matrix_synapse_docker_image_customized: "localhost/matrixdotorg/synapse:{{ matri matrix_synapse_docker_image_final: "{{ matrix_synapse_docker_image_customized if matrix_synapse_container_image_customizations_enabled else matrix_synapse_docker_image }} " matrix_synapse_base_path: "{{ matrix_base_data_path }}/synapse" + matrix_synapse_docker_src_files_path: "{{ matrix_synapse_base_path }}/docker-src" matrix_synapse_customized_docker_src_files_path: "{{ matrix_synapse_base_path }}/customized-docker-src" matrix_synapse_config_dir_path: "{{ matrix_synapse_base_path }}/config" matrix_synapse_storage_path: "{{ matrix_synapse_base_path }}/storage" matrix_synapse_media_store_path: "{{ matrix_synapse_storage_path }}/media-store" -matrix_synapse_ext_path: "{{ matrix_synapse_base_path }}/ext" matrix_synapse_bin_path: "{{ matrix_synapse_base_path }}/bin" -matrix_synapse_ext_s3_storage_provider_path: "{{ matrix_synapse_base_path }}/ext/s3-storage-provider" + +matrix_synapse_ext_path: "{{ matrix_synapse_base_path }}/ext" + +matrix_synapse_ext_s3_storage_provider_base_path: "{{ matrix_synapse_base_path }}/ext/s3-storage-provider" matrix_synapse_container_client_api_port: 8008 diff --git a/roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/setup_install.yml b/roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/setup_install.yml index 684fb2c9..b64bf6d2 100644 --- a/roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/setup_install.yml +++ b/roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/setup_install.yml @@ -10,12 +10,12 @@ - name: Ensure s3-storage-provider env file installed ansible.builtin.template: src: "{{ role_path }}/templates/synapse/ext/s3-storage-provider/env.j2" - dest: "{{ matrix_synapse_ext_s3_storage_provider_path }}/env" + dest: "{{ matrix_synapse_ext_s3_storage_provider_base_path }}/env" mode: 0640 - name: Ensure s3-storage-provider data path exists ansible.builtin.file: - path: "{{ matrix_synapse_ext_s3_storage_provider_path }}/data" + path: "{{ matrix_synapse_ext_s3_storage_provider_base_path }}/data" state: directory mode: 0750 owner: "{{ matrix_user_username }}" @@ -24,7 +24,7 @@ - name: Ensure s3-storage-provider database.yaml file installed ansible.builtin.template: src: "{{ role_path }}/templates/synapse/ext/s3-storage-provider/database.yaml.j2" - dest: "{{ matrix_synapse_ext_s3_storage_provider_path }}/data/database.yaml" + dest: "{{ matrix_synapse_ext_s3_storage_provider_base_path }}/data/database.yaml" mode: 0640 - name: Ensure s3-storage-provider scripts installed diff --git a/roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/setup_uninstall.yml b/roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/setup_uninstall.yml index d664d75f..a112a37c 100644 --- a/roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/setup_uninstall.yml +++ b/roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/setup_uninstall.yml @@ -16,4 +16,4 @@ with_items: - "{{ matrix_local_bin_path }}/matrix-synapse-s3-storage-provider-shell" - "{{ matrix_local_bin_path }}/matrix-synapse-s3-storage-provider-migrate" - - "{{ matrix_synapse_ext_s3_storage_provider_path }}" + - "{{ matrix_synapse_ext_s3_storage_provider_base_path }}" diff --git a/roles/custom/matrix-synapse/tasks/setup_install.yml b/roles/custom/matrix-synapse/tasks/setup_install.yml index 0be0fd2f..28fbc41d 100644 --- a/roles/custom/matrix-synapse/tasks/setup_install.yml +++ b/roles/custom/matrix-synapse/tasks/setup_install.yml @@ -13,7 +13,7 @@ - {path: "{{ matrix_synapse_bin_path }}", when: true} - {path: "{{ matrix_synapse_docker_src_files_path }}", when: "{{ matrix_synapse_container_image_self_build }}"} - {path: "{{ matrix_synapse_customized_docker_src_files_path }}", when: "{{ matrix_synapse_container_image_customizations_enabled }}"} - - {path: "{{ matrix_synapse_ext_s3_storage_provider_path }}", when: "{{ matrix_synapse_ext_synapse_s3_storage_provider_enabled }}"} + - {path: "{{ matrix_synapse_ext_s3_storage_provider_base_path }}", when: "{{ matrix_synapse_ext_synapse_s3_storage_provider_enabled }}"} # We handle matrix_synapse_media_store_path elsewhere (in ./synapse/setup_install.yml), # because if it's using Goofys and it's already mounted (from before), # trying to chown/chmod it here will cause trouble. diff --git a/roles/custom/matrix-synapse/tasks/validate_config.yml b/roles/custom/matrix-synapse/tasks/validate_config.yml index 0758c88f..0f63211d 100644 --- a/roles/custom/matrix-synapse/tasks/validate_config.yml +++ b/roles/custom/matrix-synapse/tasks/validate_config.yml @@ -59,6 +59,7 @@ - {'old': 'matrix_synapse_workers_frontend_proxy_workers_count', 'new': ''} - {'old': 'matrix_synapse_workers_frontend_proxy_workers_port_range_start', 'new': ''} - {'old': 'matrix_synapse_workers_frontend_proxy_workers_metrics_range_start', 'new': ''} + - {'old': 'matrix_synapse_ext_s3_storage_provider_path', 'new': 'matrix_synapse_ext_s3_storage_provider_base_path'} - name: (Deprecation) Catch and report renamed settings in matrix_synapse_configuration_extension_yaml ansible.builtin.fail: diff --git a/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/usr-local-bin/matrix-synapse-s3-storage-provider-migrate.j2 b/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/usr-local-bin/matrix-synapse-s3-storage-provider-migrate.j2 index d48ae122..70518eb4 100644 --- a/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/usr-local-bin/matrix-synapse-s3-storage-provider-migrate.j2 +++ b/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/usr-local-bin/matrix-synapse-s3-storage-provider-migrate.j2 @@ -3,9 +3,9 @@ {{ devture_systemd_docker_base_host_command_docker }} run \ --rm \ - --env-file={{ matrix_synapse_ext_s3_storage_provider_path }}/env \ + --env-file={{ matrix_synapse_ext_s3_storage_provider_base_path }}/env \ --mount type=bind,src={{ matrix_synapse_storage_path }},dst=/matrix-media-store-parent,bind-propagation=slave \ - --mount type=bind,src={{ matrix_synapse_ext_s3_storage_provider_path }}/data,dst=/data \ + --mount type=bind,src={{ matrix_synapse_ext_s3_storage_provider_base_path }}/data,dst=/data \ --workdir=/data \ --network={{ matrix_docker_network }} \ --entrypoint=/bin/bash \ diff --git a/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/usr-local-bin/matrix-synapse-s3-storage-provider-shell.j2 b/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/usr-local-bin/matrix-synapse-s3-storage-provider-shell.j2 index b46e89b7..00717705 100644 --- a/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/usr-local-bin/matrix-synapse-s3-storage-provider-shell.j2 +++ b/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/usr-local-bin/matrix-synapse-s3-storage-provider-shell.j2 @@ -4,9 +4,9 @@ {{ devture_systemd_docker_base_host_command_docker }} run \ -it \ --rm \ - --env-file={{ matrix_synapse_ext_s3_storage_provider_path }}/env \ + --env-file={{ matrix_synapse_ext_s3_storage_provider_base_path }}/env \ --mount type=bind,src={{ matrix_synapse_storage_path }},dst=/matrix-media-store-parent,bind-propagation=slave \ - --mount type=bind,src={{ matrix_synapse_ext_s3_storage_provider_path }}/data,dst=/data \ + --mount type=bind,src={{ matrix_synapse_ext_s3_storage_provider_base_path }}/data,dst=/data \ --workdir=/data \ --network={{ matrix_docker_network }} \ --entrypoint=/bin/bash \