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.
 
 

33 lines
1.8 KiB

  1. # SPDX-FileCopyrightText: 2025 Slavi Pantaleev
  2. #
  3. # SPDX-License-Identifier: AGPL-3.0-or-later
  4. ---
  5. - name: Check Matrix Federation API
  6. ansible.builtin.uri:
  7. url: "{{ matrix_synapse_federation_api_url_endpoint_public }}"
  8. follow_redirects: none
  9. validate_certs: "{{ matrix_synapse_self_check_validate_certificates }}"
  10. register: result_matrix_synapse_federation_api
  11. ignore_errors: true
  12. check_mode: false
  13. when: matrix_synapse_enabled | bool
  14. delegate_to: 127.0.0.1
  15. become: false
  16. - name: Fail if Matrix Federation API not working
  17. ansible.builtin.fail:
  18. 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 }}"
  19. 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)"
  20. - name: Fail if Matrix Federation API unexpectedly enabled
  21. ansible.builtin.fail:
  22. msg: "Matrix Federation API is up at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_synapse_federation_api_url_endpoint_public }}`) despite being disabled."
  23. when: "matrix_synapse_enabled | bool and not matrix_synapse_federation_enabled | bool and not result_matrix_synapse_federation_api.failed"
  24. - name: Report working Matrix Federation API
  25. ansible.builtin.debug:
  26. msg: "The Matrix Federation API at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_synapse_federation_api_url_endpoint_public }}`) is working"
  27. when: "matrix_synapse_enabled | bool and matrix_synapse_federation_enabled | bool"