mirror of
				https://github.com/spantaleev/matrix-docker-ansible-deploy.git
				synced 2025-11-04 00:58:56 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			54 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			54 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
# SPDX-FileCopyrightText: 2020 - 2023 Slavi Pantaleev
 | 
						|
# SPDX-FileCopyrightText: 2022 Marko Weltzer
 | 
						|
# SPDX-FileCopyrightText: 2024 Suguru Hirahara
 | 
						|
#
 | 
						|
# SPDX-License-Identifier: AGPL-3.0-or-later
 | 
						|
 | 
						|
---
 | 
						|
 | 
						|
#
 | 
						|
# Tasks related to setting up Element Web themes
 | 
						|
#
 | 
						|
 | 
						|
- when: matrix_client_element_themes_enabled | bool
 | 
						|
  run_once: true
 | 
						|
  delegate_to: 127.0.0.1
 | 
						|
  become: false
 | 
						|
  block:
 | 
						|
    - name: Ensure Element Web themes repository is pulled
 | 
						|
      ansible.builtin.git:
 | 
						|
        repo: "{{ matrix_client_element_themes_repository_url }}"
 | 
						|
        version: "{{ matrix_client_element_themes_repository_version }}"
 | 
						|
        dest: "{{ role_path }}/files/scratchpad/themes"
 | 
						|
 | 
						|
    - name: Find all Element Web theme files
 | 
						|
      ansible.builtin.find:
 | 
						|
        paths: "{{ role_path }}/files/scratchpad/themes"
 | 
						|
        patterns: "*.json"
 | 
						|
        recurse: true
 | 
						|
      register: matrix_client_element_theme_file_list
 | 
						|
 | 
						|
    - name: Read Element Web theme
 | 
						|
      ansible.builtin.slurp:
 | 
						|
        path: "{{ item.path }}"
 | 
						|
      register: "matrix_client_element_theme_file_contents"
 | 
						|
      with_items: "{{ matrix_client_element_theme_file_list.files }}"
 | 
						|
 | 
						|
    - name: Load Element Web theme
 | 
						|
      ansible.builtin.set_fact:
 | 
						|
        matrix_client_element_setting_defaults_custom_themes: "{{ matrix_client_element_setting_defaults_custom_themes + [item['content'] | b64decode | from_json] }}"  # noqa var-naming
 | 
						|
      with_items: "{{ matrix_client_element_theme_file_contents.results }}"
 | 
						|
 | 
						|
#
 | 
						|
# Tasks related to getting rid of Element Web themes (if it was previously enabled)
 | 
						|
#
 | 
						|
 | 
						|
- name: Ensure Element Web themes repository is removed
 | 
						|
  ansible.builtin.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"
 |