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.

41 lines
2.2 KiB

  1. ---
  2. - name: Fail if required Hydrogen settings not defined
  3. ansible.builtin.fail:
  4. msg: >
  5. You need to define a required configuration setting (`{{ item }}`) to use Hydrogen.
  6. when: "(vars[item] == '' or vars[item] is none) and matrix_client_hydrogen_container_image_self_build | bool"
  7. with_items:
  8. - "matrix_client_hydrogen_default_hs_url"
  9. - when: matrix_client_hydrogen_container_labels_traefik_enabled | bool
  10. block:
  11. - name: Fail if required matrix-client-hydrogen Traefik settings not defined
  12. ansible.builtin.fail:
  13. msg: >-
  14. You need to define a required configuration setting (`{{ item }}`).
  15. when: "vars[item] == ''"
  16. with_items:
  17. - matrix_client_hydrogen_container_labels_traefik_hostname
  18. - matrix_client_hydrogen_container_labels_traefik_path_prefix
  19. # We ensure it doesn't end with a slash, because we handle both (slash and no-slash).
  20. # Knowing that `matrix_client_hydrogen_container_labels_traefik_path_prefix` does not end with a slash
  21. # ensures we know how to set these routes up without having to do "does it end with a slash" checks elsewhere.
  22. - name: Fail if matrix_client_hydrogen_container_labels_traefik_path_prefix ends with a slash
  23. ansible.builtin.fail:
  24. msg: >-
  25. matrix_client_hydrogen_container_labels_traefik_path_prefix (`{{ matrix_client_hydrogen_container_labels_traefik_path_prefix }}`) must either be `/` or not end with a slash (e.g. `/hydrogen`).
  26. when: "matrix_client_hydrogen_container_labels_traefik_path_prefix != '/' and matrix_client_hydrogen_container_labels_traefik_path_prefix[-1] == '/'"
  27. # For example, we're getting errors like this:
  28. # > main.js:51 Failed to load stylesheet from https://DOMAIN/assets/theme-element-light.5316e268.css:
  29. # despite having set a prefix of `/hydrogen`.
  30. # This is yet to be investigated and workaround around.
  31. - name: Fail if matrix_client_hydrogen_container_labels_traefik_path_prefix is not /
  32. ansible.builtin.fail:
  33. msg: >-
  34. matrix_client_hydrogen_container_labels_traefik_path_prefix can only be set to `/` right now.
  35. Serving Hydrogen from another path doesn't work just yet.
  36. when: "matrix_client_hydrogen_container_labels_traefik_path_prefix != '/'"