diff --git a/roles/matrix-awx/surveys/configure_element.json.j2 b/roles/matrix-awx/surveys/configure_element.json.j2 index 89a36f39..fa5508cd 100755 --- a/roles/matrix-awx/surveys/configure_element.json.j2 +++ b/roles/matrix-awx/surveys/configure_element.json.j2 @@ -56,10 +56,46 @@ "required": false, "min": 0, "max": 1024, - "default": "{{ ext_matrix_client_element_welcome_logo_raw }}", + "default": "{{ ext_matrix_client_element_welcome_logo }}", "choices": "", "new_question": true, - "variable": "ext_matrix_client_element_welcome_logo_raw", + "variable": "ext_matrix_client_element_welcome_logo", + "type": "text" + }, + { + "question_name": "Set Welcome Page Logo URL", + "question_description": "Sets the URL link the welcome page logo leads to, must be a valid https link. Leaving this field blank will cause this default link to be used: 'https://element.io'", + "required": false, + "min": 0, + "max": 1024, + "default": "{{ ext_matrix_client_element_welcome_logo_link }}", + "choices": "", + "new_question": true, + "variable": "ext_matrix_client_element_welcome_logo_link", + "type": "text" + }, + { + "question_name": "Set Welcome Page Headline", + "question_description": "Sets the headline seen on the welcome page. Leaving this field blank will cause this default headline to be used: 'Welcome to Element'", + "required": false, + "min": 0, + "max": 512, + "default": "{{ ext_matrix_client_element_welcome_headline }}", + "choices": "", + "new_question": true, + "variable": "ext_matrix_client_element_welcome_headline", + "type": "text" + }, + { + "question_name": "Set Welcome Page Text", + "question_description": "Sets the text seen on the welcome page. Leaving this field blank will cause this default headline to be used: 'Decentralised, encrypted chat & collaboration powered by [Matrix]'", + "required": false, + "min": 0, + "max": 2048, + "default": "{{ ext_matrix_client_element_welcome_text }}", + "choices": "", + "new_question": true, + "variable": "ext_matrix_client_element_welcome_text", "type": "text" }, { diff --git a/roles/matrix-awx/tasks/set_variables_element.yml b/roles/matrix-awx/tasks/set_variables_element.yml index 9e8e937d..0e9898d7 100755 --- a/roles/matrix-awx/tasks/set_variables_element.yml +++ b/roles/matrix-awx/tasks/set_variables_element.yml @@ -21,13 +21,15 @@ line: "{{ item.key }}: {{ item.value }}" insertbefore: '# Custom Settings Start' with_dict: - 'ext_matrix_client_element_welcome_logo_raw': '{{ ext_matrix_client_element_welcome_logo_raw }}' + 'ext_matrix_client_element_welcome_logo': '{{ ext_matrix_client_element_welcome_logo }}' + 'ext_matrix_client_element_welcome_logo_link': '{{ ext_matrix_client_element_welcome_logo_link }}' + 'ext_matrix_client_element_welcome_headline': '{{ ext_matrix_client_element_welcome_headline }}' - name: Set fact for 'https' string set_fact: awx_https_string: "https" -- name: Set custom logo URL locally on AWX if defined +- name: Set custom logo locally on AWX if defined delegate_to: 127.0.0.1 lineinfile: path: '{{ awx_cached_matrix_vars }}' @@ -35,16 +37,62 @@ line: "{{ item.key }}: {{ item.value }}" insertafter: '# Element Settings Start' with_dict: - 'matrix_client_element_welcome_logo': '{{ ext_matrix_client_element_welcome_logo_raw }}' - when: ( awx_https_string in ext_matrix_client_element_welcome_logo_raw ) and ( ext_matrix_client_element_welcome_logo_raw|trim|length > 0 ) + 'matrix_client_element_welcome_logo': '{{ ext_matrix_client_element_welcome_logo }}' + when: ( awx_https_string in ext_matrix_client_element_welcome_logo ) and ( ext_matrix_client_element_welcome_logo_raw|trim|length > 0 ) -- name: Remove custom logo URL locally on AWX if not defined +- name: Remove custom logo locally on AWX if not defined delegate_to: 127.0.0.1 lineinfile: path: '{{ awx_cached_matrix_vars }}' regexp: "^matrix_client_element_welcome_logo: " state: absent - when: ext_matrix_client_element_welcome_logo_raw|trim|length == 0 + when: ext_matrix_client_element_welcome_logo|trim|length == 0 + +- name: Set custom logo link locally on AWX if defined + delegate_to: 127.0.0.1 + lineinfile: + path: '{{ awx_cached_matrix_vars }}' + regexp: "^#? *{{ item.key | regex_escape() }}:" + line: "{{ item.key }}: {{ item.value }}" + insertafter: '# Element Settings Start' + with_dict: + 'matrix_client_element_welcome_logo_link': '{{ ext_matrix_client_element_welcome_logo_link }}' + when: ( awx_https_string in ext_matrix_client_element_welcome_logo_link ) and ( ext_matrix_client_element_welcome_logo_link|trim|length > 0 ) + +- name: Remove custom logo link locally on AWX if not defined + delegate_to: 127.0.0.1 + lineinfile: + path: '{{ awx_cached_matrix_vars }}' + regexp: "^matrix_client_element_welcome_logo_link: " + state: absent + when: ext_matrix_client_element_welcome_logo_link|trim|length == 0 + +- name: Set custom headline locally on AWX if defined + delegate_to: 127.0.0.1 + lineinfile: + path: '{{ awx_cached_matrix_vars }}' + regexp: "^#? *{{ item.key | regex_escape() }}:" + line: "{{ item.key }}: {{ item.value }}" + insertafter: '# Element Settings Start' + with_dict: + 'matrix_client_element_welcome_headline': '{{ ext_matrix_client_element_welcome_headline }}' + when: ( awx_https_string in ext_matrix_client_element_welcome_headline ) and ( ext_matrix_client_element_welcome_headline|trim|length > 0 ) + +- name: Remove custom headline locally on AWX if not defined + delegate_to: 127.0.0.1 + lineinfile: + path: '{{ awx_cached_matrix_vars }}' + regexp: "^matrix_client_element_welcome_headline: " + state: absent + when: ext_matrix_client_element_welcome_headline|trim|length == 0 + +- name: Remove custom headline locally on AWX if not defined + delegate_to: 127.0.0.1 + lineinfile: + path: '{{ awx_cached_matrix_vars }}' + regexp: "^matrix_client_element_welcome_headline: " + state: absent + when: ext_matrix_client_element_welcome_headline|trim|length == 0 - name: Record Element-Web Background variable locally on AWX delegate_to: 127.0.0.1