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.
48 lines
1.5 KiB
48 lines
1.5 KiB
4 years ago
|
---
|
||
|
|
||
|
#
|
||
|
# Tasks related to setting up Element themes
|
||
|
#
|
||
|
|
||
2 years ago
|
- when: matrix_client_element_themes_enabled | bool
|
||
|
run_once: true
|
||
|
delegate_to: 127.0.0.1
|
||
|
become: false
|
||
|
block:
|
||
4 years ago
|
- name: Ensure Element themes repository is pulled
|
||
2 years ago
|
ansible.builtin.git:
|
||
4 years ago
|
repo: "{{ matrix_client_element_themes_repository_url }}"
|
||
2 years ago
|
version: "{{ matrix_client_element_themes_repository_version }}"
|
||
4 years ago
|
dest: "{{ role_path }}/files/scratchpad/themes"
|
||
|
|
||
|
- name: Find all Element theme files
|
||
2 years ago
|
ansible.builtin.find:
|
||
4 years ago
|
paths: "{{ role_path }}/files/scratchpad/themes"
|
||
|
patterns: "*.json"
|
||
|
recurse: true
|
||
|
register: matrix_client_element_theme_file_list
|
||
|
|
||
|
- name: Read Element theme
|
||
2 years ago
|
ansible.builtin.slurp:
|
||
4 years ago
|
path: "{{ item.path }}"
|
||
|
register: "matrix_client_element_theme_file_contents"
|
||
|
with_items: "{{ matrix_client_element_theme_file_list.files }}"
|
||
|
|
||
|
- name: Load Element theme
|
||
2 years ago
|
ansible.builtin.set_fact:
|
||
2 years ago
|
matrix_client_element_settingDefaults_custom_themes: "{{ matrix_client_element_settingDefaults_custom_themes + [item['content'] | b64decode | from_json] }}" # noqa var-naming
|
||
4 years ago
|
with_items: "{{ matrix_client_element_theme_file_contents.results }}"
|
||
|
|
||
|
#
|
||
|
# Tasks related to getting rid of Element themes (if it was previously enabled)
|
||
|
#
|
||
|
|
||
|
- name: Ensure Element themes repository is removed
|
||
2 years ago
|
ansible.builtin.file:
|
||
4 years ago
|
path: "{{ role_path }}/files/scratchpad/themes"
|
||
|
state: absent
|
||
|
run_once: true
|
||
|
delegate_to: 127.0.0.1
|
||
|
become: false
|
||
2 years ago
|
when: "not matrix_client_element_themes_enabled | bool"
|