Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

65 строки
2.4 KiB

  1. # SPDX-FileCopyrightText: 2019 - 2023 Slavi Pantaleev
  2. # SPDX-FileCopyrightText: 2019 Dan Arnfield
  3. # SPDX-FileCopyrightText: 2020 Chris van Dijk
  4. # SPDX-FileCopyrightText: 2020 MDAD project contributors
  5. # SPDX-FileCopyrightText: 2022 Marko Weltzer
  6. # SPDX-FileCopyrightText: 2022 Nikita Chernyi
  7. # SPDX-FileCopyrightText: 2022 Sebastian Gumprich
  8. #
  9. # SPDX-License-Identifier: AGPL-3.0-or-later
  10. ---
  11. - ansible.builtin.include_role:
  12. name: custom/matrix-base
  13. tasks_from: ensure_fuse_installed
  14. - name: Ensure Goofys Docker image is pulled
  15. community.docker.docker_image_pull:
  16. name: "{{ matrix_s3_goofys_container_image }}"
  17. pull: always
  18. register: matrix_goofys_container_image_pull_result
  19. retries: "{{ devture_playbook_help_container_retries_count }}"
  20. delay: "{{ devture_playbook_help_container_retries_delay }}"
  21. until: matrix_goofys_container_image_pull_result is not failed
  22. # This will throw a Permission Denied error if already mounted
  23. - name: Check Matrix Goofys external storage mountpoint path
  24. ansible.builtin.stat:
  25. path: "{{ matrix_s3_media_store_path }}"
  26. register: local_path_matrix_s3_media_store_path_stat
  27. ignore_errors: true
  28. - name: Ensure Matrix Goofys external storage mountpoint exists
  29. ansible.builtin.file:
  30. path: "{{ matrix_s3_media_store_path }}"
  31. state: directory
  32. mode: '0750'
  33. owner: "{{ matrix_synapse_uid }}"
  34. group: "{{ matrix_synapse_gid }}"
  35. when: "not local_path_matrix_s3_media_store_path_stat.failed and not local_path_matrix_s3_media_store_path_stat.stat.exists"
  36. - name: Ensure goofys environment variables file created
  37. ansible.builtin.template:
  38. src: "{{ role_path }}/templates/goofys/env-goofys.j2"
  39. dest: "{{ matrix_synapse_config_dir_path }}/env-goofys"
  40. owner: root
  41. mode: '0600'
  42. register: matrix_goofys_env_result
  43. - name: Ensure matrix-goofys.service installed
  44. ansible.builtin.template:
  45. src: "{{ role_path }}/templates/goofys/systemd/matrix-goofys.service.j2"
  46. dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-goofys.service"
  47. mode: '0644'
  48. register: matrix_goofys_systemd_service_result
  49. - name: Determine whether Goofys needs a restart
  50. ansible.builtin.set_fact:
  51. matrix_goofys_restart_necessary: >-
  52. {{
  53. matrix_goofys_env_result.changed | default(false)
  54. or matrix_goofys_systemd_service_result.changed | default(false)
  55. or matrix_goofys_container_image_pull_result.changed | default(false)
  56. }}