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.
 
 

70 lines
2.9 KiB

  1. ---
  2. - ansible.builtin.set_fact:
  3. matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-cactus-comments.service'] }}"
  4. when: matrix_cactus_comments_enabled | bool
  5. # If the matrix-synapse role is not used, these variables may not exist.
  6. - ansible.builtin.set_fact:
  7. matrix_homeserver_container_runtime_injected_arguments: >
  8. {{
  9. matrix_homeserver_container_runtime_injected_arguments | default([])
  10. +
  11. ["--mount type=bind,src={{ matrix_cactus_comments_app_service_config_file }},dst=/matrix-cactus-comments.yaml,ro"]
  12. }}
  13. matrix_homeserver_app_service_runtime_injected_config_files: >
  14. {{
  15. matrix_homeserver_app_service_runtime_injected_config_files | default([])
  16. +
  17. ["/matrix-cactus-comments.yaml"]
  18. }}
  19. when: matrix_cactus_comments_enabled | bool
  20. - block:
  21. - name: Fail if matrix-nginx-proxy role already executed
  22. ansible.builtin.fail:
  23. msg: >-
  24. Trying to append Cactus Comment's reverse-proxying configuration to matrix-nginx-proxy,
  25. but it's pointless since the matrix-nginx-proxy role had already executed.
  26. To fix this, please change the order of roles in your playbook,
  27. so that the matrix-nginx-proxy role would run after the matrix-cactus-comments role.
  28. when: matrix_nginx_proxy_role_executed | default(False) | bool
  29. - name: Mount volume
  30. ansible.builtin.set_fact:
  31. matrix_nginx_proxy_container_additional_volumes: >
  32. {{
  33. matrix_nginx_proxy_container_additional_volumes | default([])
  34. +
  35. [{"src": "{{ matrix_cactus_comments_client_path }}", "dst": "/cactus-comments/cactus-comments", "options": "ro"}]
  36. }}
  37. - name: Generate Cactus Comment proxying configuration for matrix-nginx-proxy
  38. ansible.builtin.set_fact:
  39. matrix_cactus_comments_nginx_proxy_configuration: |
  40. location {{ matrix_cactus_comments_client_endpoint }} {
  41. root {{ matrix_cactus_comments_client_nginx_path }};
  42. }
  43. - name: Register Cactus Comment proxying configuration with matrix-nginx-proxy
  44. ansible.builtin.set_fact:
  45. matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: |
  46. {{
  47. matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks | default([])
  48. +
  49. [matrix_cactus_comments_nginx_proxy_configuration]
  50. }}
  51. - name: Warn about reverse-proxying if matrix-nginx-proxy not used
  52. ansible.builtin.debug:
  53. msg: >-
  54. NOTE: You've enabled Cactus Comments but are not using the matrix-nginx-proxy
  55. reverse proxy.
  56. Please make sure that you're proxying client files in {{ matrix_cactus_comments_client_path }} correctly
  57. when: "not matrix_nginx_proxy_enabled | default(False) | bool"
  58. tags:
  59. - always
  60. when: matrix_cactus_comments_enabled | bool and matrix_cactus_comments_serve_client_enabled | bool