Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

53 строки
2.4 KiB

  1. - set_fact:
  2. matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-synapse-admin.service'] }}"
  3. when: matrix_synapse_admin_enabled|bool
  4. - block:
  5. - name: Fail if matrix-nginx-proxy role already executed
  6. fail:
  7. msg: >-
  8. Trying to append Synapse Admin's reverse-proxying configuration to matrix-nginx-proxy,
  9. but it's pointless since the matrix-nginx-proxy role had already executed.
  10. To fix this, please change the order of roles in your plabook,
  11. so that the matrix-nginx-proxy role would run after the matrix-synapse-admin role.
  12. when: matrix_nginx_proxy_role_executed|default(False)|bool
  13. - name: Generate Synapse Admin proxying configuration for matrix-nginx-proxy
  14. set_fact:
  15. matrix_synapse_admin_matrix_nginx_proxy_configuration: |
  16. rewrite ^{{ matrix_synapse_admin_public_endpoint }}$ $scheme://$server_name{{ matrix_synapse_admin_public_endpoint }}/ permanent;
  17. location ~ ^{{ matrix_synapse_admin_public_endpoint }}/(.*) {
  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-synapse-admin:80";
  22. proxy_pass http://$backend/$1;
  23. {% else %}
  24. {# Generic configuration for use outside of our container setup #}
  25. proxy_pass http://127.0.0.1:8766/$1;
  26. {% endif %}
  27. }
  28. - name: Register Synapse Admin proxying configuration with matrix-nginx-proxy
  29. 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_synapse_admin_matrix_nginx_proxy_configuration]
  35. }}
  36. tags:
  37. - always
  38. when: matrix_synapse_admin_enabled|bool
  39. - name: Warn about reverse-proxying if matrix-nginx-proxy not used
  40. debug:
  41. msg: >-
  42. NOTE: You've enabled the Synapse Admin tool but are not using the matrix-nginx-proxy
  43. reverse proxy.
  44. Please make sure that you're proxying the `{{ matrix_synapse_admin_public_endpoint }}`
  45. URL endpoint to the matrix-synapse-admin container.
  46. You can expose the container's port using the `matrix_synapse_admin_container_http_host_bind_port` variable.
  47. when: "matrix_synapse_admin_enabled|bool and matrix_nginx_proxy_enabled is not defined"