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.
 
 

47 rivejä
2.1 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: Report working .well-known on the matrix hostname
  16. debug:
  17. msg: "well-known is configured at `{{ hostname_matrix }}` (checked endpoint: `{{ well_known_url_matrix }}`)"
  18. - name: Check .well-known on the identity hostname
  19. uri:
  20. url: "{{ well_known_url_identity }}"
  21. follow_redirects: false
  22. register: result_well_known_identity
  23. ignore_errors: true
  24. - name: Fail if .well-known not working on the identity hostname
  25. fail:
  26. 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 }}"
  27. when: "result_well_known_identity.failed or 'json' not in result_well_known_identity"
  28. - name: Report working .well-known on the identity hostname
  29. debug:
  30. msg: "well-known is configured at `{{ hostname_identity }}` (checked endpoint: `{{ well_known_url_identity }}`)"
  31. # For people who manually copy the well-known file, try to detect if it's outdated
  32. - name: Fail if well-known is different on matrix hostname and identity hostname
  33. fail:
  34. 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?"
  35. when: "result_well_known_matrix.json|to_json != result_well_known_identity.json|to_json"