Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

59 lines
3.6 KiB

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