Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

58 строки
3.8 KiB

  1. # SPDX-FileCopyrightText: 2020 - 2025 Slavi Pantaleev
  2. # SPDX-FileCopyrightText: 2022 MDAD project contributors
  3. # SPDX-FileCopyrightText: 2025 Suguru Hirahara
  4. #
  5. # SPDX-License-Identifier: AGPL-3.0-or-later
  6. ---
  7. - name: Fail if matrix-synapse-admin is enabled for a non-Synapse homeserver
  8. ansible.builtin.fail:
  9. msg: >-
  10. matrix-synapse-admin can only be used with the Synapse homeserver implementation.
  11. Your configuration has `matrix_synapse_admin_enabled: true`, but `matrix_homeserver_implementation` is set to `{{ matrix_homeserver_implementation }}`.
  12. Disable matrix-synapse-admin or switch to Synapse.
  13. when:
  14. - matrix_synapse_admin_enabled | bool
  15. - matrix_homeserver_implementation != 'synapse'
  16. - name: (Deprecation) Catch and report renamed matrix-synapse-admin settings
  17. ansible.builtin.fail:
  18. msg: >-
  19. Your configuration contains a variable, which now has a different name.
  20. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml).
  21. when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
  22. with_items:
  23. - {'old': 'matrix_synapse_admin_docker_repo', 'new': 'matrix_synapse_admin_container_self_build_repo'}
  24. - {'old': 'matrix_synapse_admin_container_self_build', 'new': 'matrix_synapse_admin_container_image_self_build'}
  25. - {'old': 'matrix_synapse_admin_container_self_build_repo', 'new': 'matrix_synapse_admin_container_image_self_build_repo'}
  26. - {'old': 'matrix_synapse_admin_public_endpoint', 'new': 'matrix_synapse_admin_path_prefix'}
  27. - {'old': 'matrix_synapse_admin_nginx_proxy_integration_enabled', 'new': '<removed>'}
  28. - {'old': 'matrix_synapse_admin_docker_image_name_prefix', 'new': 'matrix_synapse_admin_container_image_registry_prefix'}
  29. - {'old': 'matrix_synapse_admin_docker_image', 'new': 'matrix_synapse_admin_container_image'}
  30. - {'old': 'matrix_synapse_admin_docker_image_force_pull', 'new': 'matrix_synapse_admin_container_image_force_pull'}
  31. - {'old': 'matrix_synapse_admin_docker_image_registry_prefix', 'new': 'matrix_synapse_admin_container_image_registry_prefix'}
  32. - {'old': 'matrix_synapse_admin_docker_image_registry_prefix_upstream', 'new': 'matrix_synapse_admin_container_image_registry_prefix_upstream'}
  33. - {'old': 'matrix_synapse_admin_docker_image_registry_prefix_upstream_default', 'new': 'matrix_synapse_admin_container_image_registry_prefix_upstream_default'}
  34. - {'old': 'matrix_synapse_admin_docker_src_files_path', 'new': 'matrix_synapse_admin_container_src_files_path'}
  35. - when: matrix_synapse_admin_container_labels_traefik_enabled | bool
  36. block:
  37. - name: Fail if required matrix-synapse-admin Traefik settings not defined
  38. ansible.builtin.fail:
  39. msg: >-
  40. You need to define a required configuration setting (`{{ item }}`).
  41. when: "lookup('vars', item, default='') == ''"
  42. with_items:
  43. - matrix_synapse_admin_container_labels_traefik_hostname
  44. - matrix_synapse_admin_container_labels_traefik_path_prefix
  45. # We ensure it doesn't end with a slash, because we handle both (slash and no-slash).
  46. # Knowing that `matrix_synapse_admin_container_labels_traefik_path_prefix` does not end with a slash
  47. # ensures we know how to set these routes up without having to do "does it end with a slash" checks elsewhere.
  48. - name: Fail if matrix_synapse_admin_container_labels_traefik_path_prefix ends with a slash
  49. ansible.builtin.fail:
  50. msg: >-
  51. matrix_synapse_admin_container_labels_traefik_path_prefix (`{{ matrix_synapse_admin_container_labels_traefik_path_prefix }}`) must either be `/` or not end with a slash (e.g. `/synapse-admin`).
  52. when: "matrix_synapse_admin_container_labels_traefik_path_prefix != '/' and matrix_synapse_admin_container_labels_traefik_path_prefix[-1] == '/'"