Matrix Docker Ansible eploy
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

60 řádky
2.5 KiB

  1. # SPDX-FileCopyrightText: 2022 - 2024 Slavi Pantaleev
  2. #
  3. # SPDX-License-Identifier: AGPL-3.0-or-later
  4. ---
  5. - name: Validate Matrix users to create
  6. ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/validate_user.yml"
  7. with_items: "{{ matrix_user_creator_users }}"
  8. loop_control:
  9. loop_var: user
  10. # Suppress logging to avoid dumping the credentials to the shell
  11. no_log: true
  12. - when: not matrix_authentication_service_enabled | bool
  13. block:
  14. - name: Ensure homeserver is started before creating Matrix users
  15. ansible.builtin.service:
  16. name: "matrix-{{ matrix_homeserver_implementation }}.service"
  17. state: started
  18. daemon_reload: true
  19. register: matrix_user_registrator_homeserver_start_result
  20. - name: Wait a while, so that the homeserver can manage to start before creating Matrix users
  21. ansible.builtin.pause:
  22. seconds: "{{ matrix_user_creator_homeserver_start_wait_time_seconds }}"
  23. when: matrix_user_registrator_homeserver_start_result.changed | bool
  24. - name: Ensure Matrix users are created for homeservers
  25. when: not matrix_authentication_service_enabled | bool
  26. ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/ensure_user_registered_{{ matrix_homeserver_implementation }}.yml"
  27. with_items: "{{ matrix_user_creator_users }}"
  28. loop_control:
  29. loop_var: user
  30. # Suppress logging to avoid dumping the credentials to the shell
  31. no_log: true
  32. - when: matrix_authentication_service_enabled and not matrix_authentication_service_migration_in_progress
  33. block:
  34. - name: Ensure Matrix Authentication Service is started before creating Matrix users
  35. ansible.builtin.service:
  36. name: "matrix-authentication-service.service"
  37. state: started
  38. daemon_reload: true
  39. register: matrix_user_registrator_mas_start_result
  40. - name: Wait a while, so that the Matrix Authentication Service can manage to start before creating Matrix users
  41. ansible.builtin.pause:
  42. seconds: "{{ matrix_user_creator_homeserver_start_wait_time_seconds }}"
  43. when: matrix_user_registrator_mas_start_result.changed | bool
  44. - name: Ensure Matrix users are created for Matrix Authentication Service
  45. when: matrix_authentication_service_enabled | bool
  46. ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/ensure_user_registered_matrix_authentication_service.yml"
  47. with_items: "{{ matrix_user_creator_users }}"
  48. loop_control:
  49. loop_var: user
  50. # Suppress logging to avoid dumping the credentials to the shell
  51. no_log: true