Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.3 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. worker_app: synapse.app.{{ matrix_synapse_worker_details.app }}
  3. worker_name: {{ matrix_synapse_worker_details.name }}
  4. worker_daemonize: false
  5. worker_log_config: /data/{{ matrix_server_fqn_matrix }}.log.config
  6. {% if matrix_synapse_replication_listener_enabled %}
  7. worker_replication_host: matrix-synapse
  8. worker_replication_http_port: {{ matrix_synapse_replication_http_port }}
  9. {% endif %}
  10. {% if matrix_synapse_worker_details.type == 'generic_worker' %}
  11. worker_main_http_uri: http://matrix-synapse:{{ matrix_synapse_container_client_api_port }}
  12. {% endif %}
  13. {% set http_resources = [] %}
  14. {% if matrix_synapse_worker_details.type == 'user_dir' %}
  15. {% set http_resources = http_resources + ['client'] %}
  16. {% endif %}
  17. {% if matrix_synapse_worker_details.type == 'generic_worker' %}
  18. {% set http_resources = http_resources + ['client', 'federation'] %}
  19. {% endif %}
  20. {#
  21. None of the background workers need to handle federation traffic.
  22. Only some of the stream writers need to handle client traffic.
  23. #}
  24. {% if matrix_synapse_worker_details.type == 'stream_writer' and matrix_synapse_worker_details.webserving %}
  25. {% set http_resources = http_resources + ['client'] %}
  26. {% endif %}
  27. {% if matrix_synapse_worker_details.type == 'media_repository' %}
  28. {% set http_resources = http_resources + ['media'] %}
  29. {% endif %}
  30. {% set replication_http_resources = [] %}
  31. {% if matrix_synapse_worker_details.type == 'stream_writer' %}
  32. {# All background workers need to handle replication traffic. #}
  33. {% set replication_http_resources = replication_http_resources + ['replication'] %}
  34. {% endif %}
  35. {% if http_resources|length > 0 or matrix_synapse_metrics_enabled or replication_http_resources|length > 0 %}
  36. worker_listeners:
  37. {% if http_resources|length > 0 %}
  38. - type: http
  39. bind_addresses: ['::']
  40. x_forwarded: true
  41. port: {{ matrix_synapse_worker_details.port }}
  42. resources:
  43. - names: {{ http_resources|to_json }}
  44. {% endif %}
  45. {% if matrix_synapse_metrics_enabled %}
  46. - type: metrics
  47. bind_addresses: ['0.0.0.0']
  48. port: {{ matrix_synapse_worker_details.metrics_port }}
  49. {% endif %}
  50. {% if replication_http_resources|length > 0 %}
  51. - type: http
  52. bind_addresses: ['::']
  53. port: {{ matrix_synapse_worker_details.replication_port }}
  54. resources:
  55. - names: {{ replication_http_resources|to_json }}
  56. {% endif %}
  57. {% endif %}