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.
 
 

69 line
2.5 KiB

  1. ---
  2. #
  3. # Tasks related to setting up matrix-corporal
  4. #
  5. - name: Fail if Shared Secret Auth extension not enabled
  6. fail:
  7. msg: "To use matrix-corporal, you need to enable the Shared Secret Auth module for Synapse (see matrix_synapse_ext_password_provider_shared_secret_auth_enabled)"
  8. when: "matrix_corporal_enabled and not matrix_synapse_ext_password_provider_shared_secret_auth_enabled"
  9. - name: Fail if HTTP API enabled, but no token set
  10. fail:
  11. msg: "The Matrix Corporal HTTP API is enabled, but no auth token has been set in matrix_corporal_http_api_auth_token"
  12. when: "matrix_corporal_enabled and matrix_corporal_http_api_enabled and matrix_corporal_http_api_auth_token == ''"
  13. - name: Fail if policy provider configuration not set
  14. fail:
  15. msg: "The Matrix Corporal policy provider configuration has not been set in matrix_corporal_policy_provider_config"
  16. when: "matrix_corporal_enabled and matrix_corporal_policy_provider_config == ''"
  17. - name: Override configuration specifying where the Matrix Client API is
  18. set_fact:
  19. matrix_nginx_proxy_matrix_client_api_addr_with_proxy_container: "matrix-corporal:41080"
  20. matrix_nginx_proxy_matrix_client_api_addr_sans_proxy_container: "localhost:41080"
  21. when: "matrix_corporal_enabled"
  22. - name: Ensure Matrix Corporal paths exist
  23. file:
  24. path: "{{ item }}"
  25. state: directory
  26. mode: 0750
  27. owner: "{{ matrix_user_username }}"
  28. group: "{{ matrix_user_username }}"
  29. with_items:
  30. - "{{ matrix_corporal_config_dir_path }}"
  31. - "{{ matrix_corporal_cache_dir_path }}"
  32. - "{{ matrix_corporal_var_dir_path }}"
  33. when: "matrix_corporal_enabled"
  34. - name: Ensure Matrix Corporal Docker image is pulled
  35. docker_image:
  36. name: "{{ matrix_corporal_docker_image }}"
  37. when: "matrix_corporal_enabled"
  38. - name: Ensure Matrix Corporal config installed
  39. template:
  40. src: "{{ role_path }}/templates/corporal/config.json.j2"
  41. dest: "{{ matrix_corporal_config_dir_path }}/config.json"
  42. mode: 0644
  43. when: "matrix_corporal_enabled"
  44. - name: Ensure matrix-corporal.service installed
  45. template:
  46. src: "{{ role_path }}/templates/systemd/matrix-corporal.service.j2"
  47. dest: "/etc/systemd/system/matrix-corporal.service"
  48. mode: 0644
  49. when: "matrix_corporal_enabled"
  50. #
  51. # Tasks related to getting rid of matrix-corporal (if it was previously enabled)
  52. #
  53. - name: Ensure matrix-corporal.service doesn't exist
  54. file:
  55. path: "{{ role_path }}/templates/systemd/matrix-corporal.service.j2"
  56. state: absent
  57. when: "not matrix_corporal_enabled"