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

51 строка
2.6 KiB

  1. ---
  2. - when: matrix_etherpad_enabled | bool and matrix_etherpad_mode == 'dimension'
  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 Etherpad'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-etherpad role.
  13. when: matrix_nginx_proxy_role_executed | default(False) | bool
  14. - name: Generate Etherpad proxying configuration for matrix-nginx-proxy
  15. ansible.builtin.set_fact:
  16. matrix_etherpad_matrix_nginx_proxy_configuration: |
  17. rewrite ^{{ matrix_etherpad_public_endpoint }}$ {{ matrix_nginx_proxy_x_forwarded_proto_value }}://$server_name{{ matrix_etherpad_public_endpoint }}/ permanent;
  18. location {{ matrix_etherpad_public_endpoint }}/ {
  19. {% if matrix_nginx_proxy_enabled | default(False) %}
  20. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  21. resolver 127.0.0.11 valid=5s;
  22. proxy_pass http://matrix-etherpad:9001/;
  23. {# These are proxy directives needed specifically by Etherpad #}
  24. proxy_buffering off;
  25. proxy_http_version 1.1; # recommended with keepalive connections
  26. proxy_pass_header Server;
  27. proxy_set_header Host $host;
  28. proxy_set_header X-Forwarded-Proto {{ matrix_nginx_proxy_x_forwarded_proto_value }}; # for EP to set secure cookie flag when https is used
  29. # WebSocket proxying - from http://nginx.org/en/docs/http/websocket.html
  30. proxy_set_header Upgrade $http_upgrade;
  31. proxy_set_header Connection $connection_upgrade;
  32. {% else %}
  33. {# Generic configuration for use outside of our container setup #}
  34. # A good guide for setting up your Etherpad behind nginx:
  35. # https://docs.gandi.net/en/cloud/tutorials/etherpad_lite.html
  36. proxy_pass http://127.0.0.1:9001/;
  37. {% endif %}
  38. }
  39. - name: Register Etherpad proxying configuration with matrix-nginx-proxy
  40. ansible.builtin.set_fact:
  41. matrix_nginx_proxy_proxy_dimension_additional_server_configuration_blocks: |
  42. {{
  43. matrix_nginx_proxy_proxy_dimension_additional_server_configuration_blocks | default([])
  44. +
  45. [matrix_etherpad_matrix_nginx_proxy_configuration]
  46. }}