Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

50 lines
1.5 KiB

  1. ---
  2. #
  3. # Tasks related to setting up Element themes
  4. #
  5. - block:
  6. - name: Ensure Element themes repository is pulled
  7. ansible.builtin.git:
  8. repo: "{{ matrix_client_element_themes_repository_url }}"
  9. version: "{{ matrix_client_element_themes_repository_version }}"
  10. dest: "{{ role_path }}/files/scratchpad/themes"
  11. - name: Find all Element theme files
  12. ansible.builtin.find:
  13. paths: "{{ role_path }}/files/scratchpad/themes"
  14. patterns: "*.json"
  15. recurse: true
  16. register: matrix_client_element_theme_file_list
  17. - name: Read Element theme
  18. ansible.builtin.slurp:
  19. path: "{{ item.path }}"
  20. register: "matrix_client_element_theme_file_contents"
  21. with_items: "{{ matrix_client_element_theme_file_list.files }}"
  22. - name: Load Element theme
  23. ansible.builtin.set_fact:
  24. matrix_client_element_settingDefaults_custom_themes: "{{ matrix_client_element_settingDefaults_custom_themes + [item['content'] | b64decode | from_json] }}" # noqa var-naming
  25. with_items: "{{ matrix_client_element_theme_file_contents.results }}"
  26. run_once: true
  27. delegate_to: 127.0.0.1
  28. become: false
  29. when: matrix_client_element_themes_enabled | bool
  30. #
  31. # Tasks related to getting rid of Element themes (if it was previously enabled)
  32. #
  33. - name: Ensure Element themes repository is removed
  34. ansible.builtin.file:
  35. path: "{{ role_path }}/files/scratchpad/themes"
  36. state: absent
  37. run_once: true
  38. delegate_to: 127.0.0.1
  39. become: false
  40. when: "not matrix_client_element_themes_enabled | bool"