Skip to content

Commit 291efc1

Browse files
update element section
1 parent 6a8799a commit 291efc1

File tree

2 files changed

+31
-14
lines changed

2 files changed

+31
-14
lines changed

roles/matrix-awx/surveys/configure_element.json.j2

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,6 @@
1414
"variable": "matrix_client_element_enabled",
1515
"type": "multiplechoice"
1616
},
17-
{
18-
"question_name": "Set Branding for Web Client",
19-
"question_description": "Sets the 'branding' seen in the tab and on the welcome page to a custom value.",
20-
"required": false,
21-
"min": 0,
22-
"max": 256,
23-
"default": "{{ matrix_client_element_brand }}",
24-
"choices": "",
25-
"new_question": true,
26-
"variable": "matrix_client_element_brand",
27-
"type": "text"
28-
},
2917
{
3018
"question_name": "Set Theme for Web Client",
3119
"question_description": "Sets the default theme for the web client, can be changed later by individual users.",
@@ -38,6 +26,18 @@
3826
"variable": "matrix_client_element_default_theme",
3927
"type": "multiplechoice"
4028
},
29+
{
30+
"question_name": "Set Branding for Web Client",
31+
"question_description": "Sets the 'branding' seen in the tab and on the welcome page to a custom value.Leaving this field blank will cause the default branding will be used: 'Element'",
32+
"required": false,
33+
"min": 0,
34+
"max": 256,
35+
"default": "{{ matrix_client_element_brand }}",
36+
"choices": "",
37+
"new_question": true,
38+
"variable": "matrix_client_element_brand",
39+
"type": "text"
40+
},
4141
{
4242
"question_name": "Set Welcome Page Background",
4343
"question_description": "Sets the background image on the welcome page, you should enter a URL to the image you want to use. Must be a 'https' link, otherwise it won't be set. Leaving this field blank will cause the default background to be used.",

roles/matrix-awx/tasks/set_variables_element.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,28 @@
99
insertafter: '# Element Settings Start'
1010
with_dict:
1111
'matrix_client_element_enabled': '{{ matrix_client_element_enabled }}'
12-
'matrix_client_element_jitsi_preferredDomain': '{{ matrix_client_element_jitsi_preferredDomain }}'
13-
'matrix_client_element_brand': "'{{ matrix_client_element_brand }}'"
12+
'matrix_client_element_jitsi_preferredDomain': 'jitsi.{{ matrix_domain }}'
1413
'matrix_client_element_default_theme': '{{ matrix_client_element_default_theme }}'
1514
'matrix_client_element_registration_enabled': '{{ matrix_client_element_registration_enabled }}'
1615

16+
- name: Set custom branding locally on AWX
17+
delegate_to: 127.0.0.1
18+
lineinfile:
19+
path: '{{ awx_cached_matrix_vars }}'
20+
regexp: "^#? *{{ item.key | regex_escape() }}:"
21+
line: "{{ item.key }}: '{{ item.value }}'"
22+
insertafter: '# Element Settings Start'
23+
with_dict:
24+
'matrix_client_element_brand': "{{ matrix_client_element_brand }}"
25+
26+
- name: Remove custom branding locally on AWX if not defined
27+
delegate_to: 127.0.0.1
28+
lineinfile:
29+
path: '{{ awx_cached_matrix_vars }}'
30+
regexp: "^matrix_client_element_brand: "
31+
state: absent
32+
when: matrix_client_element_brand | trim | length == 0
33+
1734
- name: Set fact for 'https' string
1835
set_fact:
1936
awx_https_string: "https"

0 commit comments

Comments
 (0)