mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2024-12-23 04:55:46 +00:00
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
|
---
|
||
|
|
||
|
#
|
||
|
# Tasks related to setting up Element themes
|
||
|
#
|
||
|
|
||
|
- block:
|
||
|
- name: Ensure Element themes repository is pulled
|
||
|
git:
|
||
|
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
|
||
|
slurp:
|
||
|
path: "{{ item.path }}"
|
||
|
register: "matrix_client_element_theme_file_contents"
|
||
|
with_items: "{{ matrix_client_element_theme_file_list.files }}"
|
||
|
|
||
|
- name: Load Element theme
|
||
|
set_fact:
|
||
|
matrix_client_element_settingDefaults_custom_themes: "{{ matrix_client_element_settingDefaults_custom_themes + [item['content'] | b64decode | from_json] }}"
|
||
|
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
|
||
|
file:
|
||
|
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"
|