Matrix Docker Ansible eploy
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 

73 行
3.3 KiB

  1. ---
  2. - ansible.builtin.set_fact:
  3. matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mautrix-wsproxy.service'] }}"
  4. when: matrix_mautrix_wsproxy_enabled|bool
  5. # If the matrix-synapse role is not used, these variables may not exist.
  6. - ansible.builtin.set_fact:
  7. matrix_synapse_container_extra_arguments: >
  8. {{
  9. matrix_synapse_container_extra_arguments | default([])
  10. +
  11. ["--mount type=bind,src={{ matrix_mautrix_wsproxy_config_path }}/androidsms-registration.yaml,dst=/matrix-mautrix-androidsms-registration.yaml,ro"]
  12. +
  13. ["--mount type=bind,src={{ matrix_mautrix_wsproxy_config_path }}/imessage-registration.yaml,dst=/matrix-mautrix-imessage-registration.yaml,ro"]
  14. }}
  15. matrix_synapse_app_service_config_files: >
  16. {{
  17. matrix_synapse_app_service_config_files | default([])
  18. +
  19. ["/matrix-mautrix-androidsms-registration.yaml"]
  20. +
  21. ["/matrix-mautrix-imessage-registration.yaml"]
  22. }}
  23. when: matrix_mautrix_wsproxy_enabled|bool
  24. - block:
  25. - name: Fail if matrix-nginx-proxy role already executed
  26. ansible.builtin.fail:
  27. msg: >-
  28. Trying to append Mautrix Wsproxy reverse-proxying configuration to matrix-nginx-proxy,
  29. but it's pointless since the matrix-nginx-proxy role had already executed.
  30. To fix this, please change the order of roles in your playbook,
  31. so that the matrix-nginx-proxy role would run after the matrix-bridge-mautrix-wsproxy role.
  32. when: matrix_nginx_proxy_role_executed|default(False)|bool
  33. - name: Generate Mautrix Wsproxy proxying configuration for matrix-nginx-proxy
  34. ansible.builtin.set_fact:
  35. matrix_mautrix_wsproxy_matrix_nginx_proxy_configuration: |
  36. location ~ ^/(_matrix/wsproxy/.*) {
  37. {% if matrix_nginx_proxy_enabled|default(False) %}
  38. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  39. resolver 127.0.0.11 valid=5s;
  40. set $backend "matrix-mautrix-wsproxy:29331";
  41. proxy_pass http://$backend;
  42. {% else %}
  43. {# Generic configuration for use outside of our container setup #}
  44. proxy_pass http://127.0.0.1:29331;
  45. {% endif %}
  46. }
  47. - name: Register Mautrix Wsproxy proxying configuration with matrix-nginx-proxy
  48. ansible.builtin.set_fact:
  49. matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: |
  50. {{
  51. matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([])
  52. +
  53. [matrix_mautrix_wsproxy_matrix_nginx_proxy_configuration]
  54. }}
  55. tags:
  56. - always
  57. when: matrix_mautrix_wsproxy_enabled|bool
  58. - name: Warn about reverse-proxying if matrix-nginx-proxy not used
  59. ansible.builtin.debug:
  60. msg: >-
  61. NOTE: You've enabled the Mautrix wsproxy bridge but are not using the matrix-nginx-proxy
  62. reverse proxy.
  63. Please make sure that you're proxying the `{{ matrix_mautrix_wsproxy_public_endpoint }}`
  64. URL endpoint to the matrix-mautrix-wsproxy container.
  65. You can expose the container's port using the `matrix_mautrix_wsproxy_container_http_host_bind_port` variable.
  66. when: "matrix_mautrix_wsproxy_enabled|bool and matrix_nginx_proxy_enabled is not defined"