Matrix Docker Ansible eploy
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

60 行
2.2 KiB

  1. # SPDX-FileCopyrightText: 2020 - 2023 Slavi Pantaleev
  2. # SPDX-FileCopyrightText: 2022 Marko Weltzer
  3. # SPDX-FileCopyrightText: 2024 Suguru Hirahara
  4. #
  5. # SPDX-License-Identifier: AGPL-3.0-or-later
  6. ---
  7. #
  8. # Tasks related to setting up Element Web themes
  9. #
  10. - when: matrix_client_element_themes_enabled | bool
  11. run_once: true
  12. delegate_to: 127.0.0.1
  13. become: false
  14. block:
  15. # This checkout lives on the Ansible controller, so we cannot correct its ownership like we do for checkouts on the server.
  16. # Marking it as a safe directory keeps git's dubious-ownership protection from failing the task when the playbook directory belongs to another user.
  17. - name: Ensure Element Web themes repository is pulled
  18. ansible.builtin.git:
  19. repo: "{{ matrix_client_element_themes_repository_url }}"
  20. version: "{{ matrix_client_element_themes_repository_version }}"
  21. dest: "{{ role_path }}/files/scratchpad/themes"
  22. environment:
  23. GIT_CONFIG_COUNT: "1"
  24. GIT_CONFIG_KEY_0: safe.directory
  25. GIT_CONFIG_VALUE_0: "{{ role_path }}/files/scratchpad/themes"
  26. - name: Find all Element Web theme files
  27. ansible.builtin.find:
  28. paths: "{{ role_path }}/files/scratchpad/themes"
  29. patterns: "*.json"
  30. recurse: true
  31. register: matrix_client_element_theme_file_list
  32. - name: Read Element Web theme
  33. ansible.builtin.slurp:
  34. path: "{{ item.path }}"
  35. register: "matrix_client_element_theme_file_contents"
  36. with_items: "{{ matrix_client_element_theme_file_list.files }}"
  37. - name: Load Element Web theme
  38. ansible.builtin.set_fact:
  39. matrix_client_element_setting_defaults_custom_themes: "{{ matrix_client_element_setting_defaults_custom_themes + [item['content'] | b64decode | from_json] }}" # noqa var-naming
  40. with_items: "{{ matrix_client_element_theme_file_contents.results }}"
  41. #
  42. # Tasks related to getting rid of Element Web themes (if it was previously enabled)
  43. #
  44. - name: Ensure Element Web themes repository is removed
  45. ansible.builtin.file:
  46. path: "{{ role_path }}/files/scratchpad/themes"
  47. state: absent
  48. run_once: true
  49. delegate_to: 127.0.0.1
  50. become: false
  51. when: "not matrix_client_element_themes_enabled | bool"