Matrix Docker Ansible eploy
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 

64 líneas
2.6 KiB

  1. ---
  2. - ansible.builtin.set_fact:
  3. matrix_jitsi_prosody_self_check_uvs_health_url: "{{ matrix_jitsi_prosody_auth_matrix_uvs_location }}/health"
  4. matrix_jitsi_element_jitsi_well_known_url: "{{ matrix_jitsi_web_public_url }}/.well-known/element/jitsi"
  5. - name: Check if jitsi serves the .well-known/element/jitsi
  6. ansible.builtin.uri:
  7. url: "{{ matrix_jitsi_element_jitsi_well_known_url }}"
  8. follow_redirects: none
  9. return_content: true
  10. validate_certs: "{{ matrix_jitsi_self_check_validate_certificates }}"
  11. headers:
  12. Origin: example.com
  13. check_mode: false
  14. register: result_well_known_jitsi_element_jitsi
  15. ignore_errors: true
  16. - name: Fail if .well-known not working
  17. ansible.builtin.fail:
  18. msg: |
  19. Failed checking that the Jitsi well-known file for Element auth is configured at `{{ matrix_jitsi_element_jitsi_well_known_url }}`
  20. Full error: {{ result_well_known_jitsi_element_jitsi }}
  21. when: "result_well_known_jitsi_element_jitsi.failed"
  22. - name: Parse JSON for well-known payload at the matrix hostname
  23. ansible.builtin.set_fact:
  24. well_known_matrix_payload: "{{ result_well_known_jitsi_element_jitsi.content | from_json }}"
  25. - name: Fail if .well-known not CORS-aware
  26. ansible.builtin.fail:
  27. msg: "The well-known file on `{{ matrix_jitsi_element_jitsi_well_known_url }}` is not CORS-aware. The file needs to be served with an Access-Control-Allow-Origin header set."
  28. when: "'access_control_allow_origin' not in result_well_known_jitsi_element_jitsi"
  29. - name: Report working .well-known
  30. ansible.builtin.debug:
  31. msg: "well-known is configured correctly at `{{ matrix_jitsi_element_jitsi_well_known_url }}`"
  32. - name: Check if we can reach the user verification service and if it's healthy
  33. ansible.builtin.command:
  34. argv:
  35. - "docker"
  36. - "exec"
  37. - "matrix-jitsi-prosody"
  38. - "wget"
  39. - "-O"
  40. - "-"
  41. - "--quiet"
  42. - "{{ matrix_jitsi_prosody_self_check_uvs_health_url | quote }}"
  43. register: matrix_jitsi_prosody_self_check_uvs_result
  44. changed_when: false
  45. ignore_errors: true
  46. - name: Fail if user verification service is not (reachable and healthy)
  47. ansible.builtin.fail:
  48. msg: |
  49. Failed checking user verification service is up (checked endpoint: `{{ matrix_jitsi_prosody_self_check_uvs_health_url }}`).
  50. Full error: {{ matrix_jitsi_prosody_self_check_uvs_result }}
  51. when: "matrix_jitsi_prosody_self_check_uvs_result.failed"
  52. - name: Report healthy user verification service
  53. ansible.builtin.debug:
  54. msg: "User verification service is working (checked endpoint: `{{ matrix_jitsi_prosody_self_check_uvs_health_url }}`)"