Matrix Docker Ansible eploy
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

87 linhas
2.8 KiB

  1. #
  2. # Tasks related to setting up Goofys
  3. #
  4. - name: Ensure Goofys Docker image is pulled
  5. docker_image:
  6. name: "{{ matrix_s3_goofys_docker_image }}"
  7. when: matrix_s3_media_store_enabled
  8. # This will throw a Permission Denied error if already mounted
  9. - name: Check Matrix Goofys external storage mountpoint path
  10. stat:
  11. path: "{{ matrix_synapse_media_store_path }}"
  12. register: local_path_matrix_synapse_media_store_path_stat
  13. ignore_errors: yes
  14. when: matrix_s3_media_store_enabled
  15. - name: Ensure Matrix Goofys external storage mountpoint exists
  16. file:
  17. path: "{{ matrix_synapse_media_store_path }}"
  18. state: directory
  19. mode: 0750
  20. owner: "{{ matrix_user_uid }}"
  21. group: "{{ matrix_user_gid }}"
  22. when: "matrix_s3_media_store_enabled and not local_path_matrix_synapse_media_store_path_stat.failed and not local_path_matrix_synapse_media_store_path_stat.stat.exists"
  23. - name: Ensure goofys environment variables file created
  24. template:
  25. src: "{{ role_path }}/templates/goofys/env-goofys.j2"
  26. dest: "{{ matrix_synapse_config_dir_path }}/env-goofys"
  27. owner: root
  28. mode: 0600
  29. when: matrix_s3_media_store_enabled
  30. - name: Ensure matrix-goofys.service installed
  31. template:
  32. src: "{{ role_path }}/templates/goofys/systemd/matrix-goofys.service.j2"
  33. dest: "/etc/systemd/system/matrix-goofys.service"
  34. mode: 0644
  35. register: matrix_goofys_systemd_service_result
  36. when: matrix_s3_media_store_enabled
  37. - name: Ensure systemd reloaded after matrix-goofys.service installation
  38. service:
  39. daemon_reload: yes
  40. when: "matrix_s3_media_store_enabled and matrix_goofys_systemd_service_result.changed"
  41. #
  42. # Tasks related to getting rid of goofys (if it was previously enabled)
  43. #
  44. - name: Check existence of matrix-goofys service
  45. stat:
  46. path: "/etc/systemd/system/matrix-goofys.service"
  47. register: matrix_goofys_service_stat
  48. - name: Ensure matrix-goofys is stopped
  49. service:
  50. name: matrix-goofys
  51. state: stopped
  52. daemon_reload: yes
  53. register: stopping_result
  54. when: "not matrix_s3_media_store_enabled and matrix_goofys_service_stat.stat.exists"
  55. - name: Ensure matrix-goofys.service doesn't exist
  56. file:
  57. path: "/etc/systemd/system/matrix-goofys.service"
  58. state: absent
  59. when: "not matrix_s3_media_store_enabled and matrix_goofys_service_stat.stat.exists"
  60. - name: Ensure systemd reloaded after matrix-goofys.service removal
  61. service:
  62. daemon_reload: yes
  63. when: "not matrix_s3_media_store_enabled and matrix_goofys_service_stat.stat.exists"
  64. - name: Ensure goofys environment variables file doesn't exist
  65. file:
  66. path: "{{ matrix_synapse_config_dir_path }}/env-goofys"
  67. state: absent
  68. when: "not matrix_s3_media_store_enabled"
  69. - name: Ensure Goofys Docker image doesn't exist
  70. docker_image:
  71. name: "{{ matrix_s3_goofys_docker_image }}"
  72. state: absent
  73. when: "not matrix_s3_media_store_enabled"