2020-07-17 08:31:20 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
#
|
|
|
|
# Tasks related to setting up Element themes
|
|
|
|
#
|
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: Ensure Element themes repository is pulled
|
2022-07-18 07:39:08 +00:00
|
|
|
ansible.builtin.git:
|
2020-07-17 08:31:20 +00:00
|
|
|
repo: "{{ matrix_client_element_themes_repository_url }}"
|
|
|
|
dest: "{{ role_path }}/files/scratchpad/themes"
|
|
|
|
|
|
|
|
- name: Find all Element theme files
|
|
|
|
find:
|
|
|
|
paths: "{{ role_path }}/files/scratchpad/themes"
|
|
|
|
patterns: "*.json"
|
|
|
|
recurse: true
|
|
|
|
register: matrix_client_element_theme_file_list
|
|
|
|
|
|
|
|
- name: Read Element theme
|
2022-07-18 07:39:08 +00:00
|
|
|
ansible.builtin.slurp:
|
2020-07-17 08:31:20 +00:00
|
|
|
path: "{{ item.path }}"
|
|
|
|
register: "matrix_client_element_theme_file_contents"
|
|
|
|
with_items: "{{ matrix_client_element_theme_file_list.files }}"
|
|
|
|
|
|
|
|
- name: Load Element theme
|
2022-07-18 07:39:08 +00:00
|
|
|
ansible.builtin.set_fact:
|
2022-02-05 20:32:54 +00:00
|
|
|
matrix_client_element_settingDefaults_custom_themes: "{{ matrix_client_element_settingDefaults_custom_themes + [item['content'] | b64decode | from_json] }}"
|
2020-07-17 08:31:20 +00:00
|
|
|
with_items: "{{ matrix_client_element_theme_file_contents.results }}"
|
|
|
|
|
|
|
|
run_once: true
|
|
|
|
delegate_to: 127.0.0.1
|
|
|
|
become: false
|
|
|
|
when: matrix_client_element_themes_enabled|bool
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Tasks related to getting rid of Element themes (if it was previously enabled)
|
|
|
|
#
|
|
|
|
|
|
|
|
- name: Ensure Element themes repository is removed
|
2022-07-18 07:39:08 +00:00
|
|
|
ansible.builtin.file:
|
2020-07-17 08:31:20 +00:00
|
|
|
path: "{{ role_path }}/files/scratchpad/themes"
|
|
|
|
state: absent
|
|
|
|
run_once: true
|
|
|
|
delegate_to: 127.0.0.1
|
|
|
|
become: false
|
|
|
|
when: "not matrix_client_element_themes_enabled|bool"
|