Skip to content

Commit 85bc12d

Browse files
saner handling of background variable
1 parent 79acf6f commit 85bc12d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

roles/matrix-awx/tasks/set_variables_element.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
state: absent
9595
when: awx_matrix_client_element_welcome_text | trim | length == 0
9696

97-
- name: Record Element-Web Background variable locally on AWX
97+
- name: Set element-web background locally on AWX if defined
9898
delegate_to: 127.0.0.1
9999
lineinfile:
100100
path: '{{ awx_cached_matrix_vars }}'
@@ -103,7 +103,15 @@
103103
insertafter: '# Element Settings Start'
104104
with_dict:
105105
'matrix_client_element_branding_welcomeBackgroundUrl': '{{ matrix_client_element_branding_welcomeBackgroundUrl }}'
106-
when: ( awx_https_string in matrix_client_element_branding_welcomeBackgroundUrl ) and ( matrix_client_element_branding_welcomeBackgroundUrl | trim | length > 0 )
106+
when: matrix_client_element_branding_welcomeBackgroundUrl | trim | length > 0
107+
108+
- name: Remove element-web background locally on AWX if not defined
109+
delegate_to: 127.0.0.1
110+
lineinfile:
111+
path: '{{ awx_cached_matrix_vars }}'
112+
regexp: "^matrix_client_element_branding_welcomeBackgroundUrl: "
113+
state: absent
114+
when: matrix_client_element_branding_welcomeBackgroundUrl | trim | length == 0
107115

108116
- name: Save new 'Configure Element' survey.json to the AWX tower, template
109117
delegate_to: 127.0.0.1

0 commit comments

Comments
 (0)