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

53 строки
2.9 KiB

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