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.
 
 

27 line
1.5 KiB

  1. ---
  2. - name: Check Matrix Federation API
  3. ansible.builtin.uri:
  4. url: "{{ matrix_dendrite_federation_api_url_endpoint_public }}"
  5. follow_redirects: none
  6. validate_certs: "{{ matrix_dendrite_self_check_validate_certificates }}"
  7. register: result_matrix_dendrite_federation_api
  8. ignore_errors: true
  9. check_mode: false
  10. delegate_to: 127.0.0.1
  11. become: false
  12. - name: Fail if Matrix Federation API not working
  13. ansible.builtin.fail:
  14. msg: "Failed checking Matrix Federation API is up at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_dendrite_federation_api_url_endpoint_public }}`). Is Dendrite running? Is port {{ matrix_federation_public_port }} open in your firewall? Full error: {{ result_matrix_dendrite_federation_api }}"
  15. when: "matrix_dendrite_federation_enabled | bool and (result_matrix_dendrite_federation_api.failed or 'json' not in result_matrix_dendrite_federation_api)"
  16. - name: Fail if Matrix Federation API unexpectedly enabled
  17. ansible.builtin.fail:
  18. msg: "Matrix Federation API is up at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_dendrite_federation_api_url_endpoint_public }}`) despite being disabled."
  19. when: "not matrix_dendrite_federation_enabled | bool and not result_matrix_dendrite_federation_api.failed"
  20. - name: Report working Matrix Federation API
  21. ansible.builtin.debug:
  22. msg: "The Matrix Federation API at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_dendrite_federation_api_url_endpoint_public }}`) is working"
  23. when: "matrix_dendrite_federation_enabled | bool"