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

47 строки
2.2 KiB

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