mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-03-31 06:59:44 +00:00
Add conditional restart support to matrix-synapse-s3-storage-provider-migrate
Register env, database config, scripts, and systemd service/timer results, compute matrix_synapse_s3_storage_provider_restart_necessary, and wire it into group_vars/matrix_servers instead of hardcoding restart_necessary: true. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -27,12 +27,14 @@
|
||||
src: "{{ role_path }}/templates/synapse/ext/s3-storage-provider/env.j2"
|
||||
dest: "{{ matrix_synapse_ext_s3_storage_provider_base_path }}/env"
|
||||
mode: '0640'
|
||||
register: matrix_synapse_s3_storage_provider_env_result
|
||||
|
||||
- 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_data_path }}/database.yaml"
|
||||
mode: '0640'
|
||||
register: matrix_synapse_s3_storage_provider_database_config_result
|
||||
|
||||
- name: Ensure s3-storage-provider scripts installed
|
||||
ansible.builtin.template:
|
||||
@@ -42,6 +44,7 @@
|
||||
with_items:
|
||||
- shell
|
||||
- migrate
|
||||
register: matrix_synapse_s3_storage_provider_scripts_result
|
||||
|
||||
- name: Ensure matrix-synapse-s3-storage-provider-migrate.service and timer are installed
|
||||
ansible.builtin.template:
|
||||
@@ -52,3 +55,13 @@
|
||||
- matrix-synapse-s3-storage-provider-migrate.service
|
||||
- matrix-synapse-s3-storage-provider-migrate.timer
|
||||
register: matrix_synapse_s3_storage_provider_systemd_service_result
|
||||
|
||||
- name: Determine whether s3-storage-provider migrate timer needs a restart
|
||||
ansible.builtin.set_fact:
|
||||
matrix_synapse_s3_storage_provider_restart_necessary: >-
|
||||
{{
|
||||
matrix_synapse_s3_storage_provider_env_result.changed | default(false)
|
||||
or matrix_synapse_s3_storage_provider_database_config_result.changed | default(false)
|
||||
or matrix_synapse_s3_storage_provider_scripts_result.changed | default(false)
|
||||
or matrix_synapse_s3_storage_provider_systemd_service_result.changed | default(false)
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user