Matrix Docker Ansible eploy
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

51 wiersze
2.4 KiB

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