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.
 
 

37 lines
2.0 KiB

  1. # SPDX-FileCopyrightText: 2018 - 2022 Slavi Pantaleev
  2. # SPDX-FileCopyrightText: 2019 - 2020 Dan Arnfield
  3. # SPDX-FileCopyrightText: 2019 Lorrin Nelson
  4. # SPDX-FileCopyrightText: 2020 MDAD project contributors
  5. # SPDX-FileCopyrightText: 2022 Marko Weltzer
  6. #
  7. # SPDX-License-Identifier: AGPL-3.0-or-later
  8. ---
  9. - name: Check Matrix Federation API
  10. ansible.builtin.uri:
  11. url: "{{ matrix_synapse_federation_api_url_endpoint_public }}"
  12. follow_redirects: none
  13. validate_certs: "{{ matrix_synapse_self_check_validate_certificates }}"
  14. register: result_matrix_synapse_federation_api
  15. ignore_errors: true
  16. check_mode: false
  17. when: matrix_synapse_enabled | bool
  18. delegate_to: 127.0.0.1
  19. become: false
  20. - name: Fail if Matrix Federation API not working
  21. ansible.builtin.fail:
  22. msg: "Failed checking Matrix Federation API is up at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_synapse_federation_api_url_endpoint_public }}`). Is Synapse running? Is port {{ matrix_federation_public_port }} open in your firewall? Full error: {{ result_matrix_synapse_federation_api }}"
  23. when: "matrix_synapse_enabled | bool and matrix_synapse_federation_enabled | bool and (result_matrix_synapse_federation_api.failed or 'json' not in result_matrix_synapse_federation_api)"
  24. - name: Fail if Matrix Federation API unexpectedly enabled
  25. ansible.builtin.fail:
  26. msg: "Matrix Federation API is up at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_synapse_federation_api_url_endpoint_public }}`) despite being disabled."
  27. when: "matrix_synapse_enabled | bool and not matrix_synapse_federation_enabled | bool and not result_matrix_synapse_federation_api.failed"
  28. - name: Report working Matrix Federation API
  29. ansible.builtin.debug:
  30. msg: "The Matrix Federation API at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_synapse_federation_api_url_endpoint_public }}`) is working"
  31. when: "matrix_synapse_enabled | bool and matrix_synapse_federation_enabled | bool"