Matrix Docker Ansible eploy
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

57 lines
3.0 KiB

  1. # SPDX-FileCopyrightText: 2024 MDAD Team and contributors
  2. #
  3. # SPDX-License-Identifier: AGPL-3.0-or-later
  4. ---
  5. - name: Fail if required Dimension settings not defined
  6. ansible.builtin.fail:
  7. msg: >
  8. You need to define a required configuration setting (`{{ item.name }}`).
  9. when: "item.when | bool and vars[item.name] == ''"
  10. with_items:
  11. - {'name': 'matrix_dimension_hostname', when: true}
  12. - {'name': 'matrix_dimension_container_network', when: true}
  13. - {'name': 'matrix_dimension_access_token', when: true}
  14. - {'name': 'matrix_dimension_homeserver_clientServerUrl', when: true}
  15. - {'name': 'matrix_dimension_homeserver_federationUrl', when: true}
  16. - {'name': 'matrix_dimension_homeserver_mediaUrl', when: true}
  17. - {'name': 'matrix_dimension_database_hostname', when: "{{ matrix_dimension_database_engine == 'postgres' }}"}
  18. - name: (Deprecation) Catch and report renamed Dimension variables
  19. ansible.builtin.fail:
  20. msg: >-
  21. Your configuration contains a variable, which now has a different name.
  22. Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
  23. when: "item.old in vars"
  24. with_items:
  25. - {'old': 'matrix_dimension_container_expose_port', 'new': '<superseded by matrix_dimension_container_http_host_bind_port>'}
  26. - when: matrix_dimension_container_labels_traefik_enabled | bool
  27. block:
  28. - name: Fail if required Dimension Traefik settings not defined
  29. ansible.builtin.fail:
  30. msg: >-
  31. You need to define a required configuration setting (`{{ item }}`).
  32. when: "vars[item] == ''"
  33. with_items:
  34. - matrix_dimension_container_labels_traefik_hostname
  35. - matrix_dimension_container_labels_traefik_path_prefix
  36. # We ensure it doesn't end with a slash, because we handle both (slash and no-slash).
  37. # Knowing that `matrix_dimension_container_labels_traefik_path_prefix` does not end with a slash
  38. # ensures we know how to set these routes up without having to do "does it end with a slash" checks elsewhere.
  39. - name: Fail if matrix_dimension_container_labels_traefik_path_prefix ends with a slash
  40. ansible.builtin.fail:
  41. msg: >-
  42. matrix_dimension_container_labels_traefik_path_prefix (`{{ matrix_dimension_container_labels_traefik_path_prefix }}`) must either be `/` or not end with a slash (e.g. `/dimension`).
  43. when: "matrix_dimension_container_labels_traefik_path_prefix != '/' and matrix_dimension_container_labels_traefik_path_prefix[-1] == '/'"
  44. - name: Fail if matrix_dimension_container_labels_traefik_path_prefix is not /
  45. ansible.builtin.fail:
  46. msg: >-
  47. matrix_dimension_container_labels_traefik_path_prefix (`{{ matrix_dimension_container_labels_traefik_path_prefix }}`) must currently be set to `/`.
  48. Other values are not supported.
  49. See: https://github.com/turt2live/matrix-dimension/issues/510
  50. when: "matrix_dimension_container_labels_traefik_path_prefix != '/' and matrix_dimension_container_labels_traefik_path_prefix[-1] == '/'"