Matrix Docker Ansible eploy
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 

88 righe
2.9 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. when: "not matrix_s3_media_store_enabled"
  49. - name: Ensure matrix-goofys is stopped
  50. service:
  51. name: matrix-goofys
  52. state: stopped
  53. daemon_reload: yes
  54. register: stopping_result
  55. when: "not matrix_s3_media_store_enabled and matrix_goofys_service_stat.stat.exists"
  56. - name: Ensure matrix-goofys.service doesn't exist
  57. file:
  58. path: "/etc/systemd/system/matrix-goofys.service"
  59. state: absent
  60. when: "not matrix_s3_media_store_enabled and matrix_goofys_service_stat.stat.exists"
  61. - name: Ensure systemd reloaded after matrix-goofys.service removal
  62. service:
  63. daemon_reload: yes
  64. when: "not matrix_s3_media_store_enabled and matrix_goofys_service_stat.stat.exists"
  65. - name: Ensure goofys environment variables file doesn't exist
  66. file:
  67. path: "{{ matrix_synapse_config_dir_path }}/env-goofys"
  68. state: absent
  69. when: "not matrix_s3_media_store_enabled"
  70. - name: Ensure Goofys Docker image doesn't exist
  71. docker_image:
  72. name: "{{ matrix_s3_goofys_docker_image }}"
  73. state: absent
  74. when: "not matrix_s3_media_store_enabled"