From 927633321abbf9b3dd7d25796eb0719f34e5da14 Mon Sep 17 00:00:00 2001 From: Michael Collins Date: Mon, 11 Oct 2021 13:34:46 +0800 Subject: [PATCH] update element section --- .../surveys/configure_element.json.j2 | 16 ++++++------- .../tasks/set_variables_element.yml | 23 ++++++++++--------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/roles/matrix-awx/surveys/configure_element.json.j2 b/roles/matrix-awx/surveys/configure_element.json.j2 index ef9b5d07..9c0398cc 100755 --- a/roles/matrix-awx/surveys/configure_element.json.j2 +++ b/roles/matrix-awx/surveys/configure_element.json.j2 @@ -32,10 +32,10 @@ "required": false, "min": 0, "max": 256, - "default": "{{ awx_matrix_client_element_brand }}", + "default": "{{ matrix_client_element_brand }}", "choices": "", "new_question": true, - "variable": "awx_matrix_client_element_brand", + "variable": "matrix_client_element_brand", "type": "text" }, { @@ -44,10 +44,10 @@ "required": false, "min": 0, "max": 1024, - "default": "{{ awx_matrix_client_element_branding_welcomeBackgroundUrl }}", + "default": "{{ matrix_client_element_branding_welcomeBackgroundUrl }}", "choices": "", "new_question": true, - "variable": "awx_matrix_client_element_branding_welcomeBackgroundUrl", + "variable": "matrix_client_element_branding_welcomeBackgroundUrl", "type": "text" }, { @@ -56,10 +56,10 @@ "required": false, "min": 0, "max": 1024, - "default": "{{ awx_matrix_client_element_welcome_logo }}", + "default": "{{ matrix_client_element_welcome_logo }}", "choices": "", "new_question": true, - "variable": "awx_matrix_client_element_welcome_logo", + "variable": "matrix_client_element_welcome_logo", "type": "text" }, { @@ -68,10 +68,10 @@ "required": false, "min": 0, "max": 1024, - "default": "{{ awx_matrix_client_element_welcome_logo_link }}", + "default": "{{ matrix_client_element_welcome_logo_link }}", "choices": "", "new_question": true, - "variable": "awx_matrix_client_element_welcome_logo_link", + "variable": "matrix_client_element_welcome_logo_link", "type": "text" }, { diff --git a/roles/matrix-awx/tasks/set_variables_element.yml b/roles/matrix-awx/tasks/set_variables_element.yml index fc9e275a..5589b23e 100755 --- a/roles/matrix-awx/tasks/set_variables_element.yml +++ b/roles/matrix-awx/tasks/set_variables_element.yml @@ -12,6 +12,10 @@ 'matrix_client_element_jitsi_preferredDomain': 'jitsi.{{ matrix_domain }}' 'matrix_client_element_default_theme': '{{ matrix_client_element_default_theme }}' 'matrix_client_element_registration_enabled': '{{ matrix_client_element_registration_enabled }}' + 'matrix_client_element_brand': '{{ matrix_client_element_brand }}' + 'matrix_client_element_branding_welcomeBackgroundUrl:' '{{ matrix_client_element_branding_welcomeBackgroundUrl }}' + 'matrix_client_element_welcome_logo': '{{ matrix_client_element_welcome_logo }}' + 'matrix_client_element_welcome_logo_link': '{{ matrix_client_element_welcome_logo_link }}' - name: Record Element-Web custom variables locally on AWX delegate_to: 127.0.0.1 @@ -21,10 +25,6 @@ line: "{{ item.key }}: '{{ item.value }}'" insertbefore: '# Element Settings End' with_dict: - 'awx_matrix_client_element_brand': '{{ awx_matrix_client_element_brand }}' - 'awx_matrix_client_element_branding_welcomeBackgroundUrl:' '{{ awx_matrix_client_element_branding_welcomeBackgroundUrl }}' - 'awx_matrix_client_element_welcome_logo': '{{ awx_matrix_client_element_welcome_logo }}' - 'awx_matrix_client_element_welcome_logo_link': '{{ awx_matrix_client_element_welcome_logo_link }}' 'awx_matrix_client_element_welcome_headline': '{{ awx_matrix_client_element_welcome_headline }}' 'awx_matrix_client_element_welcome_text': '{{ awx_matrix_client_element_welcome_text }}' @@ -36,7 +36,8 @@ line: "{{ item.key }}: '{{ item.value }}'" insertafter: '# Element Settings Start' with_dict: - 'matrix_client_element_brand': "{{ awx_matrix_client_element_brand }}" + 'matrix_client_element_brand': "{{ matrix_client_element_brand }}" + when: matrix_client_element_brand | trim | length > 0 - name: Remove Element-Web custom branding locally on AWX if not defined delegate_to: 127.0.0.1 @@ -44,7 +45,7 @@ path: '{{ awx_cached_matrix_vars }}' regexp: "^matrix_client_element_brand: " state: absent - when: awx_matrix_client_element_brand | trim | length == 0 + when: matrix_client_element_brand | trim | length == 0 - name: Set fact for 'https' string set_fact: @@ -58,8 +59,8 @@ line: "{{ item.key }}: '{{ item.value }}'" insertafter: '# Element Settings Start' with_dict: - 'matrix_client_element_welcome_logo': '{{ awx_matrix_client_element_welcome_logo }}' - when: ( awx_https_string in awx_matrix_client_element_welcome_logo ) and ( awx_matrix_client_element_welcome_logo | trim | length > 0 ) + 'matrix_client_element_welcome_logo': '{{ matrix_client_element_welcome_logo }}' + when: ( awx_https_string in matrix_client_element_welcome_logo ) and ( matrix_client_element_welcome_logo | trim | length > 0 ) - name: Remove Element-Web custom logo locally on AWX if not defined delegate_to: 127.0.0.1 @@ -67,7 +68,7 @@ path: '{{ awx_cached_matrix_vars }}' regexp: "^matrix_client_element_welcome_logo: " state: absent - when: awx_matrix_client_element_welcome_logo | trim | length == 0 + when: matrix_client_element_welcome_logo | trim | length == 0 - name: Set Element-Web custom logo link locally on AWX if defined delegate_to: 127.0.0.1 @@ -78,7 +79,7 @@ insertafter: '# Element Settings Start' with_dict: 'matrix_client_element_welcome_logo_link': '{{ matrix_client_element_welcome_logo_link }}' - when: ( awx_https_string in awx_matrix_client_element_welcome_logo_link ) and ( awx_matrix_client_element_welcome_logo_link | trim | length > 0 ) + when: ( awx_https_string in matrix_client_element_welcome_logo_link ) and ( matrix_client_element_welcome_logo_link | trim | length > 0 ) - name: Remove Element-Web custom logo link locally on AWX if not defined delegate_to: 127.0.0.1 @@ -86,7 +87,7 @@ path: '{{ awx_cached_matrix_vars }}' regexp: "^matrix_client_element_welcome_logo_link: " state: absent - when: awx_matrix_client_element_welcome_logo_link | trim | length == 0 + when: matrix_client_element_welcome_logo_link | trim | length == 0 - name: Set Element-Web custom headline locally on AWX if defined delegate_to: 127.0.0.1