Matrix Docker Ansible eploy
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

56 satır
2.8 KiB

  1. ---
  2. - set_fact:
  3. well_known_url_matrix: "https://{{ hostname_matrix }}/.well-known/matrix/client"
  4. well_known_url_identity: "https://{{ hostname_identity }}/.well-known/matrix/client"
  5. - name: Check .well-known on the matrix hostname
  6. uri:
  7. url: "{{ well_known_url_matrix }}"
  8. follow_redirects: false
  9. register: result_well_known_matrix
  10. ignore_errors: true
  11. - name: Fail if .well-known not working on the matrix hostname
  12. fail:
  13. msg: "Failed checking well-known is configured at `{{ hostname_matrix }}` (checked endpoint: `{{ well_known_url_matrix }}`). Is port 443 open in your firewall? Full error: {{ result_well_known_matrix }}"
  14. when: "result_well_known_matrix.failed or 'json' not in result_well_known_matrix"
  15. - name: Fail if .well-known not CORS-aware on the matrix hostname
  16. fail:
  17. msg: "Well-known serving for `{{ hostname_matrix }}` (checked endpoint: `{{ well_known_url_matrix }}`) is not CORS-aware. The file needs to be served with an Access-Control-Allow-Origin header set."
  18. when: "'access_control_allow_origin' not in result_well_known_matrix"
  19. - name: Report working .well-known on the matrix hostname
  20. debug:
  21. msg: "well-known is configured correctly for `{{ hostname_matrix }}` (checked endpoint: `{{ well_known_url_matrix }}`)"
  22. - name: Check .well-known on the identity hostname
  23. uri:
  24. url: "{{ well_known_url_identity }}"
  25. follow_redirects: false
  26. register: result_well_known_identity
  27. ignore_errors: true
  28. - name: Fail if .well-known not working on the identity hostname
  29. fail:
  30. msg: "Failed checking well-known is configured at `{{ hostname_identity }}` (checked endpoint: `{{ well_known_url_identity }}`). Is port 443 open in your firewall? Full error: {{ result_well_known_identity }}"
  31. when: "result_well_known_identity.failed or 'json' not in result_well_known_identity"
  32. - name: Fail if .well-known not CORS-aware on the identity hostname
  33. fail:
  34. msg: "Well-known serving for `{{ hostname_identity }}` (checked endpoint: `{{ well_known_url_identity }}`) is not CORS-aware. The file needs to be served with an Access-Control-Allow-Origin header set. See docs/configuring-well-known.md"
  35. when: "'access_control_allow_origin' not in result_well_known_identity"
  36. # For people who manually copy the well-known file, try to detect if it's outdated
  37. - name: Fail if well-known is different on matrix hostname and identity hostname
  38. fail:
  39. msg: "The well-known files at `{{ hostname_matrix }}` and `{{ hostname_identity }}` are different. Perhaps you copied the file manually before and now it's outdated?"
  40. when: "result_well_known_matrix.json|to_json != result_well_known_identity.json|to_json"
  41. - name: Report working .well-known on the identity hostname
  42. debug:
  43. msg: "well-known is configured correctly for `{{ hostname_identity }}` (checked endpoint: `{{ well_known_url_identity }}`)"