瀏覽代碼

fix(mas): keep Synapse stopped after syn2mas migration

Avoid reopening a transition window where Synapse can accept new registrations or other auth changes
after syn2mas completes but before the MAS cutover is finalized.

Inspired by and continuing the work done in: https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/5097
pull/5101/head
Slavi Pantaleev 3 週之前
父節點
當前提交
94a0a6c6ec
共有 2 個檔案被更改,包括 12 行新增4 行删除
  1. +2
    -0
      docs/configuring-playbook-matrix-authentication-service.md
  2. +10
    -4
      roles/custom/matrix-authentication-service/tasks/mas_cli_syn2mas.yml

+ 2
- 0
docs/configuring-playbook-matrix-authentication-service.md 查看文件

@@ -398,6 +398,8 @@ To perform a real migration, run the `matrix-authentication-service-mas-cli-syn2
just run-tags matrix-authentication-service-mas-cli-syn2mas
```

After `syn2mas` completes, Synapse will intentionally remain stopped to avoid new registrations or other authentication changes from being accepted before the migration is completed. Continue with the next steps in this guide before re-running the installation.

Having performed a `syn2mas` migration once, trying to do it again will report errors (e.g. "Error: The MAS database is not empty: rows found in at least `users`. Please drop and recreate the database, then try again.").

## Verify that Matrix Authentication Service is installed correctly


+ 10
- 4
roles/custom/matrix-authentication-service/tasks/mas_cli_syn2mas.yml 查看文件

@@ -110,11 +110,17 @@
ansible.builtin.debug:
var: matrix_authentication_service_mas_cli_syn2mas_command_result

- name: Ensure Synapse is started (if it previously was)
- name: Inject syn2mas post-migration note
when: "not matrix_authentication_service_syn2mas_migrate_dry_run and matrix_authentication_service_mas_cli_syn2mas_command_result.changed"
ansible.builtin.service:
name: matrix-synapse
state: started
ansible.builtin.set_fact:
devture_playbook_runtime_messages_list: |
{{
devture_playbook_runtime_messages_list | default([])
+
[
"Synapse was intentionally not restarted after `syn2mas`. Continue with the next steps in the Matrix Authentication Service migration guide before re-running the installation."
]
}}

- name: Ensure Matrix Authentication Service is started (if it previously was)
when: "not matrix_authentication_service_syn2mas_migrate_dry_run and matrix_authentication_service_mas_ensure_stopped_result.changed"


Loading…
取消
儲存