mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-04-19 20:01:09 +03:00
Compare commits
2 Commits
5f8235f44a
...
09914bf338
| Author | SHA1 | Date | |
|---|---|---|---|
| 09914bf338 | |||
| 44b43a51b9 |
@@ -3299,6 +3299,9 @@ ddclient_identifier: matrix-dynamic-dns
|
||||
|
||||
ddclient_base_path: "{{ matrix_base_data_path }}/dynamic-dns"
|
||||
|
||||
ddclient_uid: "{{ matrix_user_uid }}"
|
||||
ddclient_gid: "{{ matrix_user_gid }}"
|
||||
|
||||
ddclient_container_image_registry_prefix: "{{ 'localhost/' if ddclient_container_image_self_build else ddclient_container_image_registry_prefix_upstream }}"
|
||||
ddclient_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else ddclient_docker_image_registry_prefix_upstream_default }}"
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
---
|
||||
|
||||
- name: Ensure Synapse user registered - {{ user.username | quote }}
|
||||
ansible.builtin.command:
|
||||
cmd: |-
|
||||
- name: Build Synapse user registration command - {{ user.username | quote }}
|
||||
ansible.builtin.set_fact:
|
||||
matrix_synapse_register_user_command: |-
|
||||
{{ devture_systemd_docker_base_host_command_docker }} exec matrix-synapse
|
||||
register_new_matrix_user
|
||||
-u {{ user.username | quote }}
|
||||
@@ -21,6 +21,31 @@
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
http://localhost:{{ matrix_synapse_container_client_api_port }}
|
||||
|
||||
- name: Ensure Synapse user registered - {{ user.username | quote }}
|
||||
ansible.builtin.command:
|
||||
cmd: "{{ matrix_synapse_register_user_command }}"
|
||||
register: matrix_synapse_register_user_result
|
||||
changed_when: matrix_synapse_register_user_result.rc == 0 and 'User ID already taken' not in matrix_synapse_register_user_result.stdout
|
||||
failed_when: matrix_synapse_register_user_result.rc != 0 and 'User ID already taken' not in matrix_synapse_register_user_result.stdout
|
||||
failed_when: >-
|
||||
matrix_synapse_register_user_result.rc != 0
|
||||
and 'User ID already taken' not in matrix_synapse_register_user_result.stdout
|
||||
and 'HMAC incorrect' not in matrix_synapse_register_user_result.stdout
|
||||
|
||||
- when: "'HMAC incorrect' in matrix_synapse_register_user_result.stdout | default('')"
|
||||
block:
|
||||
- name: Restart Synapse due to HMAC failure (likely a registration_shared_secret change)
|
||||
ansible.builtin.service:
|
||||
name: "matrix-synapse.service"
|
||||
state: restarted
|
||||
|
||||
- name: Wait for Synapse to start after restart
|
||||
ansible.builtin.pause:
|
||||
seconds: "{{ matrix_user_creator_homeserver_start_wait_time_seconds }}"
|
||||
|
||||
- name: Retry Synapse user registration - {{ user.username | quote }}
|
||||
ansible.builtin.command:
|
||||
cmd: "{{ matrix_synapse_register_user_command }}"
|
||||
register: matrix_synapse_register_user_result
|
||||
changed_when: matrix_synapse_register_user_result.rc == 0 and 'User ID already taken' not in matrix_synapse_register_user_result.stdout
|
||||
failed_when: matrix_synapse_register_user_result.rc != 0 and 'User ID already taken' not in matrix_synapse_register_user_result.stdout
|
||||
|
||||
Reference in New Issue
Block a user