Matrix Docker Ansible eploy
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 

49 lignes
2.2 KiB

  1. ---
  2. - name: Fail if matrix-nginx-proxy role already executed
  3. ansible.builtin.fail:
  4. msg: >-
  5. Trying to append Mautrix Wsproxy reverse-proxying configuration to matrix-nginx-proxy,
  6. but it's pointless since the matrix-nginx-proxy role had already executed.
  7. To fix this, please change the order of roles in your playbook,
  8. so that the matrix-nginx-proxy role would run after the matrix-bridge-mautrix-wsproxy role.
  9. when: matrix_nginx_proxy_role_executed | default(False) | bool
  10. - tags:
  11. - always
  12. when: matrix_mautrix_wsproxy_enabled|bool
  13. block:
  14. - name: Generate Mautrix Wsproxy proxying configuration for matrix-nginx-proxy
  15. ansible.builtin.set_fact:
  16. matrix_mautrix_wsproxy_matrix_nginx_proxy_configuration: |
  17. location ~ ^/(_matrix/wsproxy/.*) {
  18. {% if matrix_nginx_proxy_enabled|default(False) %}
  19. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  20. resolver 127.0.0.11 valid=5s;
  21. set $backend "matrix-mautrix-wsproxy:29331";
  22. proxy_pass http://$backend;
  23. {% else %}
  24. {# Generic configuration for use outside of our container setup #}
  25. proxy_pass http://127.0.0.1:29331;
  26. {% endif %}
  27. }
  28. - name: Register Mautrix Wsproxy proxying configuration with matrix-nginx-proxy
  29. ansible.builtin.set_fact:
  30. matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: |
  31. {{
  32. matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([])
  33. +
  34. [matrix_mautrix_wsproxy_matrix_nginx_proxy_configuration]
  35. }}
  36. - name: Warn about reverse-proxying if matrix-nginx-proxy not used
  37. ansible.builtin.debug:
  38. msg: >-
  39. NOTE: You've enabled the Mautrix wsproxy bridge but are not using the matrix-nginx-proxy
  40. reverse proxy.
  41. Please make sure that you're proxying the `{{ matrix_mautrix_wsproxy_public_endpoint }}`
  42. URL endpoint to the matrix-mautrix-wsproxy container.
  43. You can expose the container's port using the `matrix_mautrix_wsproxy_container_http_host_bind_port` variable.
  44. when: "matrix_mautrix_wsproxy_enabled|bool and matrix_nginx_proxy_enabled is not defined"