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

48 строки
2.5 KiB

  1. ---
  2. - when: matrix_ldap_registration_proxy_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 Matrix LDAP registration proxy'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-bridge-mautrix-telegram role.
  13. when: matrix_nginx_proxy_role_executed | default(False) | bool
  14. - name: Generate Matrix LDAP registration proxy proxying configuration for matrix-nginx-proxy
  15. ansible.builtin.set_fact:
  16. matrix_ldap_registration_proxy_matrix_nginx_proxy_configuration: |
  17. location {{ matrix_ldap_registration_proxy_registration_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_ldap_registration_proxy_registration_addr_with_container }}";
  22. proxy_pass http://$backend/register;
  23. {% else %}
  24. {# Generic configuration for use outside of our container setup #}
  25. proxy_pass http://{{ matrix_ldap_registration_proxy_registration_addr_sans_container }}/register;
  26. {% endif %}
  27. }
  28. - name: Register Matrix LDAP registration proxy 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_ldap_registration_proxy_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 Matrix LDAP registration proxy bridge but are not using the matrix-nginx-proxy
  40. reverse proxy.
  41. Please make sure that you're proxying the `{{ matrix_ldap_registration_proxy_public_endpoint }}`
  42. URL endpoint to the matrix-ldap-proxy container.
  43. You can expose the container's port using the `matrix_ldap_registration_proxy_container_http_host_bind_port` variable.
  44. when: "not matrix_nginx_proxy_enabled | default(False) | bool"