diff --git a/ansible/roles/showroom/tasks/60-showroom-verify.yml b/ansible/roles/showroom/tasks/60-showroom-verify.yml index b87b0e12d6..cedfc39b31 100644 --- a/ansible/roles/showroom/tasks/60-showroom-verify.yml +++ b/ansible/roles/showroom/tasks/60-showroom-verify.yml @@ -5,11 +5,25 @@ - name: Compute port suffix when non-standard port is used ansible.builtin.set_fact: - f_port_suffix: "{% if (showroom_primary_port | default(443) | int) != 443 %}:{{ showroom_primary_port }}{% endif %}" + f_port_suffix: >- + {% if (showroom_primary_port | default(443) | int) not in [443, 80] -%} + :{{ showroom_primary_port }} + {%- endif %} + +- name: Compute URL scheme + ansible.builtin.set_fact: + f_url_scheme: >- + {% if (showroom_primary_port | default(443) | int) == 80 -%} + http + {%- else -%} + https + {%- endif %} - name: Capture lab_ui_url as fact ansible.builtin.set_fact: - f_lab_ui_url: "https://{{ showroom_host }}{{ f_port_suffix | default('') }}/{{ showroom_primary_path }}" + f_lab_ui_url: >- + {{ f_url_scheme }}://{{ showroom_host -}} + {{ f_port_suffix | default('') }}/{{ showroom_primary_path }} - name: Output showroom view(s) URLs as userinfo and userdata agnosticd_user_info: diff --git a/ansible/roles/showroom/templates/index.html.j2 b/ansible/roles/showroom/templates/index.html.j2 index 8f403fae9b..9c7fe0b5be 100644 --- a/ansible/roles/showroom/templates/index.html.j2 +++ b/ansible/roles/showroom/templates/index.html.j2 @@ -15,7 +15,7 @@ {% elif showroom_tab_services | length > 0 %}
- +