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.
 
 

51 lignes
2.3 KiB

  1. - set_fact:
  2. matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-synapse-admin'] }}"
  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. location ~ ^{{ matrix_synapse_admin_public_endpoint }}/?(.*) {
  17. {% if matrix_nginx_proxy_enabled|default(False) %}
  18. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  19. resolver 127.0.0.11 valid=5s;
  20. set $backend "matrix-synapse-admin:80";
  21. proxy_pass http://$backend/$1;
  22. {% else %}
  23. {# Generic configuration for use outside of our container setup #}
  24. proxy_pass http://127.0.0.1:8766/$1;
  25. {% endif %}
  26. }
  27. - name: Register Synapse Admin proxying configuration with matrix-nginx-proxy
  28. set_fact:
  29. matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: |
  30. {{
  31. matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([])
  32. +
  33. [matrix_synapse_admin_matrix_nginx_proxy_configuration]
  34. }}
  35. tags:
  36. - always
  37. when: matrix_synapse_admin_enabled|bool
  38. - name: Warn about reverse-proxying if matrix-nginx-proxy not used
  39. debug:
  40. msg: >-
  41. NOTE: You've enabled the Synapse Admin tool but are not using the matrix-nginx-proxy
  42. reverse proxy.
  43. Please make sure that you're proxying the `{{ matrix_synapse_admin_public_endpoint }}`
  44. URL endpoint to the matrix-synapse-admin container.
  45. You can expose the container's port using the `matrix_synapse_admin_container_http_host_bind_port` variable.
  46. when: "matrix_synapse_admin_enabled|bool and matrix_nginx_proxy_enabled is not defined"