Matrix Docker Ansible eploy
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

47 satır
2.3 KiB

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