Matrix Docker Ansible eploy
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

66 řádky
2.3 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. # There are some additional initialization tasks in setup_corporal_overrides.yml,
  18. # which need to always run, no matter what tag the playbook is running with.
  19. - name: Ensure Matrix Corporal paths exist
  20. file:
  21. path: "{{ item }}"
  22. state: directory
  23. mode: 0750
  24. owner: "{{ matrix_user_username }}"
  25. group: "{{ matrix_user_username }}"
  26. with_items:
  27. - "{{ matrix_corporal_config_dir_path }}"
  28. - "{{ matrix_corporal_cache_dir_path }}"
  29. - "{{ matrix_corporal_var_dir_path }}"
  30. when: "matrix_corporal_enabled"
  31. - name: Ensure Matrix Corporal Docker image is pulled
  32. docker_image:
  33. name: "{{ matrix_corporal_docker_image }}"
  34. when: "matrix_corporal_enabled"
  35. - name: Ensure Matrix Corporal config installed
  36. template:
  37. src: "{{ role_path }}/templates/corporal/config.json.j2"
  38. dest: "{{ matrix_corporal_config_dir_path }}/config.json"
  39. mode: 0644
  40. when: "matrix_corporal_enabled"
  41. - name: Ensure matrix-corporal.service installed
  42. template:
  43. src: "{{ role_path }}/templates/systemd/matrix-corporal.service.j2"
  44. dest: "/etc/systemd/system/matrix-corporal.service"
  45. mode: 0644
  46. when: "matrix_corporal_enabled"
  47. #
  48. # Tasks related to getting rid of matrix-corporal (if it was previously enabled)
  49. #
  50. - name: Ensure matrix-corporal.service doesn't exist
  51. file:
  52. path: "/etc/systemd/system/matrix-corporal.service"
  53. state: absent
  54. when: "not matrix_corporal_enabled"