Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ansible/roles/showroom/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,6 @@ showroom_pip_packages:
showroom_work_dirs:
- "{{ showroom_user_home_dir }}/content" # The showroom repo itself, asciidoc source e.g. Antora
- "{{ showroom_user_home_dir }}/orchestration" # compose, kube files etc

# Add a random path to the showroom endpoint ie. https://guid.sandbox1234.showroom.com/this-should-be-random/showroom
showroom_random_path: this-should-be-random
2 changes: 1 addition & 1 deletion ansible/roles/showroom/tasks/60-showroom-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- name: Capture lab_ui_url as fact
ansible.builtin.set_fact:
f_lab_ui_url:
"https://{{ showroom_host }}:{{ showroom_primary_port }}/{{ showroom_primary_path }}"
"https://{{ showroom_host }}:{{ showroom_primary_port }}/{{ showroom_random_path }}/{{ showroom_primary_path }}"

- name: Output showroom view(s) URLs as userinfo and userdata
agnosticd_user_info:
Expand Down
5 changes: 5 additions & 0 deletions ansible/roles/showroom/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
when: showroom_deploy | default(true) | bool
block:

- name: Generate random showroom path if not provided
when: showroom_random_path is not defined or showroom_random_path in ['', 'this-should-be-random']
ansible.builtin.set_fact:
showroom_random_path: "{{ lookup('password', '/dev/null', 'length=12', 'chars=ascii_letters,digits') | lower }}"

- name: Setup OS dependencies, packages
ansible.builtin.include_tasks:
file: 10-showroom-dependencies.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ showroom:
- "traefik.http.services.showroom.loadbalancer.server.port=80"
- "traefik.http.routers.entrypoints=showroomsecure"
- "traefik.http.routers.showroom.tls.certresolver=le"
- "traefik.http.routers.showroom.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/showroom`)"
- "traefik.http.routers.showroom.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/{{ showroom_random_path }}/showroom`)"
- "traefik.http.routers.showroom.middlewares=showroom-stripprefix"
- "traefik.http.middlewares.showroom-stripprefix.stripprefix.prefixes=/showroom"
- "traefik.http.middlewares.showroom-stripprefix.stripprefix.prefixes=/{{ showroom_random_path }}/showroom"
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ codeserver:
- "traefik.enable=true"
- "traefik.http.services.vscode.loadbalancer.server.port=8080"
- "traefik.http.routers.vscode.tls.certresolver=le"
- "traefik.http.routers.vscode.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/codeserver`)"
- "traefik.http.routers.vscode.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/{{ showroom_random_path }}/codeserver`)"
- "traefik.http.routers.vscode.middlewares=vscode-stripprefix"
- "traefik.http.middlewares.vscode-stripprefix.stripprefix.prefixes=/codeserver"
- "traefik.http.middlewares.vscode-stripprefix.stripprefix.prefixes=/{{ showroom_random_path }}/codeserver"
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div id="codeserver_tab" class="tabcontent">
<iframe id="codeserver" src="https://{{ showroom_host }}:{{ showroom_primary_port }}/codeserver/" width="100%" style="border:none;"></iframe>
<iframe id="codeserver" src="https://{{ showroom_host }}:{{ showroom_primary_port }}/{{ showroom_random_path }}/codeserver/" width="100%" style="border:none;"></iframe>
</div>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div id="tty1_tab" class="tabcontent">
<iframe id="tty1" src="https://{{ showroom_host }}:{{ showroom_primary_port }}/tty1/" width="100%" style="border:none;"></iframe>
<iframe id="tty1" src="https://{{ showroom_host }}:{{ showroom_primary_port }}/{{ showroom_random_path }}/tty1/" width="100%" style="border:none;"></iframe>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ tty-top:
- "traefik.http.services.tty-top.loadbalancer.server.port=3000"
- "traefik.http.routers.tty-topentrypoints=terminalsecure"
- "traefik.http.routers.tty-top.tls.certresolver=le"
- "traefik.http.routers.tty-top.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/tty-top`)"
- "traefik.http.routers.tty-top.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/{{ showroom_random_path }}/tty-top`)"
- "traefik.http.routers.tty-top.middlewares=terminal-stripprefix"
- "traefik.http.routers.tty-top.middlewares=tty-toptheader"
- "traefik.http.middlewares.tty-top-stripprefix.stripprefix.prefixes=/tty-top"
- "traefik.http.middlewares.tty-top-stripprefix.stripprefix.prefixes=/{{ showroom_random_path }}/tty-top"
- "traefik.http.middlewares.tty-toptheader.headers.customrequestheaders.X-Content-Type-Options=false"

tty-bottom:
Expand Down Expand Up @@ -62,8 +62,8 @@ tty-bottom:
- "traefik.http.services.tty-bottom.loadbalancer.server.port=3000"
- "traefik.http.routers.tty-bottomentrypoints=terminalsecure"
- "traefik.http.routers.tty-bottom.tls.certresolver=le"
- "traefik.http.routers.tty-bottom.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/tty-bottom`)"
- "traefik.http.routers.tty-bottom.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/{{ showroom_random_path }}/tty-bottom`)"
- "traefik.http.routers.tty-bottom.middlewares=terminal-stripprefix"
- "traefik.http.routers.tty-bottom.middlewares=tty-bottomtheader"
- "traefik.http.middlewares.tty-bottom-stripprefix.stripprefix.prefixes=/tty-bottom"
- "traefik.http.middlewares.tty-bottom-stripprefix.stripprefix.prefixes=/{{ showroom_random_path }}/tty-bottom"
- "traefik.http.middlewares.tty-bottomtheader.headers.customrequestheaders.X-Content-Type-Options=false"
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<div id="terminal_tab" class="tabcontent">
<div class="split top">
<iframe id="tty-top"
src="https://{{ showroom_host }}:{{ showroom_primary_port }}/tty-top/"
src="https://{{ showroom_host }}:{{ showroom_primary_port }}/{{ showroom_random_path }}/tty-top/"
allow="fullscreen; clipboard-read"
width="100%"
style="border:none;"
></iframe>
</div>
<div class="split bottom">
<iframe id="tty-bottom"
src="https://{{ showroom_host }}:{{ showroom_primary_port }}/tty-bottom/"
src="https://{{ showroom_host }}:{{ showroom_primary_port }}/{{ showroom_random_path }}/tty-bottom/"
allow="fullscreen; clipboard-read"
width="100%"
style="border:none;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ terminal-02:
- "traefik.http.services.terminal2.loadbalancer.server.port=3001"
- "traefik.http.routers.terminalentrypoints2=terminalsecure2"
- "traefik.http.routers.terminal2.tls.certresolver=le"
- "traefik.http.routers.terminal2.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/tty2`)"
- "traefik.http.routers.terminal2.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/{{ showroom_random_path }}/tty2`)"
- "traefik.http.routers.terminal2.middlewares=terminal-stripprefix"
- "traefik.http.routers.terminal2.middlewares=testheader"
- "traefik.http.middlewares.terminal-stripprefix2.stripprefix.prefixes=/tty2"
- "traefik.http.middlewares.terminal-stripprefix2.stripprefix.prefixes=/{{ showroom_random_path }}/tty2"
- "traefik.http.middlewares.testheader2.headers.customrequestheaders.X-Content-Type-Options=false"
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div id="terminal_tab2" class="tabcontent">
<iframe id="terminal_02" src="https://{{ showroom_host }}:{{ showroom_primary_port }}/tty2/" width="100%" style="border:none;"></iframe>
<iframe id="terminal_02" src="https://{{ showroom_host }}:{{ showroom_primary_port }}/{{ showroom_random_path }}/tty2/" width="100%" style="border:none;"></iframe>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ terminal-01:
- "traefik.http.services.terminal.loadbalancer.server.port=3000"
- "traefik.http.routers.terminalentrypoints=terminalsecure"
- "traefik.http.routers.terminal.tls.certresolver=le"
- "traefik.http.routers.terminal.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/wetty`)"
- "traefik.http.routers.terminal.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/{{ showroom_random_path }}/wetty`)"
- "traefik.http.routers.terminal.middlewares=terminal-stripprefix"
- "traefik.http.routers.terminal.middlewares=testheader"
- "traefik.http.middlewares.terminal-stripprefix.stripprefix.prefixes=/wetty"
- "traefik.http.middlewares.terminal-stripprefix.stripprefix.prefixes=/{{ showroom_random_path }}/wetty"
- "traefik.http.middlewares.testheader.headers.customrequestheaders.X-Content-Type-Options=false"
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div id="terminal_tab" class="tabcontent">
<iframe id="terminal_01" src="https://{{ showroom_host }}:{{ showroom_primary_port }}/wetty/" width="100%" style="border:none;"></iframe>
<iframe id="terminal_01" src="https://{{ showroom_host }}:{{ showroom_primary_port }}/{{ showroom_random_path }}/wetty/" width="100%" style="border:none;"></iframe>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ tty-triple-top:
- "traefik.http.services.tty-triple-top.loadbalancer.server.port=3000"
- "traefik.http.routers.tty-triple-topentrypoints=terminalsecure"
- "traefik.http.routers.tty-triple-top.tls.certresolver=le"
- "traefik.http.routers.tty-triple-top.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/tty-triple-top`)"
- "traefik.http.routers.tty-triple-top.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/{{ showroom_random_path }}/tty-triple-top`)"
- "traefik.http.routers.tty-triple-top.middlewares=terminal-stripprefix"
- "traefik.http.routers.tty-triple-top.middlewares=tty-triple-toptheader"
- "traefik.http.middlewares.tty-triple-top-stripprefix.stripprefix.prefixes=/tty-triple-top"
- "traefik.http.middlewares.tty-triple-top-stripprefix.stripprefix.prefixes=/{{ showroom_random_path }}/tty-triple-top"
- "traefik.http.middlewares.tty-triple-toptheader.headers.customrequestheaders.X-Content-Type-Options=false"


Expand Down Expand Up @@ -63,10 +63,10 @@ tty-triple-middle:
- "traefik.http.services.tty-triple-middle.loadbalancer.server.port=3000"
- "traefik.http.routers.tty-triple-middleentrypoints=terminalsecure"
- "traefik.http.routers.tty-triple-middle.tls.certresolver=le"
- "traefik.http.routers.tty-triple-middle.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/tty-triple-middle`)"
- "traefik.http.routers.tty-triple-middle.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/{{ showroom_random_path }}/tty-triple-middle`)"
- "traefik.http.routers.tty-triple-middle.middlewares=terminal-stripprefix"
- "traefik.http.routers.tty-triple-middle.middlewares=tty-triple-middletheader"
- "traefik.http.middlewares.tty-triple-middle-stripprefix.stripprefix.prefixes=/tty-triple-middle"
- "traefik.http.middlewares.tty-triple-middle-stripprefix.stripprefix.prefixes=/{{ showroom_random_path }}/tty-triple-middle"
- "traefik.http.middlewares.tty-triple-middletheader.headers.customrequestheaders.X-Content-Type-Options=false"


Expand Down Expand Up @@ -99,8 +99,8 @@ tty-triple-bottom:
- "traefik.http.services.tty-triple-bottom.loadbalancer.server.port=3000"
- "traefik.http.routers.tty-triple-bottomentrypoints=terminalsecure"
- "traefik.http.routers.tty-triple-bottom.tls.certresolver=le"
- "traefik.http.routers.tty-triple-bottom.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/tty-triple-bottom`)"
- "traefik.http.routers.tty-triple-bottom.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/{{ showroom_random_path }}/tty-triple-bottom`)"
- "traefik.http.routers.tty-triple-bottom.middlewares=terminal-stripprefix"
- "traefik.http.routers.tty-triple-bottom.middlewares=tty-triple-bottomtheader"
- "traefik.http.middlewares.tty-triple-bottom-stripprefix.stripprefix.prefixes=/tty-triple-bottom"
- "traefik.http.middlewares.tty-triple-bottom-stripprefix.stripprefix.prefixes=/{{ showroom_random_path }}/tty-triple-bottom"
- "traefik.http.middlewares.tty-triple-bottomtheader.headers.customrequestheaders.X-Content-Type-Options=false"
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
<div class="split top">
<iframe
id="tty-triple-top"
src="https://{{ showroom_host }}:{{ showroom_primary_port }}/tty-top/"
src="https://{{ showroom_host }}:{{ showroom_primary_port }}/{{ showroom_random_path }}/tty-top/"
width="100%"
style="border:none;">
</iframe>
</div>
<div class="split middle">
<iframe
id="tty-triple-middle"
src="https://{{ showroom_host }}:{{ showroom_primary_port }}/tty-top/"
src="https://{{ showroom_host }}:{{ showroom_primary_port }}/{{ showroom_random_path }}/tty-top/"
width="100%"
style="border:none;">
</iframe>
</div>
<div class="split bottom">
<iframe id="tty-triple-bottom"
src="https://{{ showroom_host }}:{{ showroom_primary_port }}/tty-bottom/"
src="https://{{ showroom_host }}:{{ showroom_primary_port }}/{{ showroom_random_path }}/tty-bottom/"
width="100%"
style="border:none;">
</iframe>
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/showroom/templates/service_tty1/service_tty1.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ tty1:
- "traefik.http.services.tty1.loadbalancer.server.port=3000"
- "traefik.http.routers.tty1entrypoints=terminalsecure"
- "traefik.http.routers.tty1.tls.certresolver=le"
- "traefik.http.routers.tty1.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/tty1`)"
- "traefik.http.routers.tty1.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/{{ showroom_random_path }}/tty1`)"
- "traefik.http.routers.tty1.middlewares=terminal-stripprefix"
- "traefik.http.routers.tty1.middlewares=tty1theader"
- "traefik.http.middlewares.tty1-stripprefix.stripprefix.prefixes=/tty1"
- "traefik.http.middlewares.tty1-stripprefix.stripprefix.prefixes=/{{ showroom_random_path }}/tty1"
- "traefik.http.middlewares.tty1theader.headers.customrequestheaders.X-Content-Type-Options=false"
2 changes: 1 addition & 1 deletion ansible/roles/showroom/templates/service_tty1/tab_tty1.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div id="tty1_tab" class="tabcontent">
<iframe id="tty1" src="https://{{ showroom_host }}:{{ showroom_primary_port }}/tty1/" width="100%" style="border:none;"></iframe>
<iframe id="tty1" src="https://{{ showroom_host }}:{{ showroom_primary_port }}/{{ showroom_random_path }}/tty1/" width="100%" style="border:none;"></iframe>
</div>
4 changes: 2 additions & 2 deletions ansible/roles/showroom/templates/service_tty2/service_tty2.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ tty2:
- "traefik.http.services.tty2.loadbalancer.server.port=3000"
- "traefik.http.routers.tty2entrypoints=terminalsecure"
- "traefik.http.routers.tty2.tls.certresolver=le"
- "traefik.http.routers.tty2.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/tty2`)"
- "traefik.http.routers.tty2.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/{{ showroom_random_path }}/tty2`)"
- "traefik.http.routers.tty2.middlewares=terminal-stripprefix"
- "traefik.http.routers.tty2.middlewares=tty2theader"
- "traefik.http.middlewares.tty2-stripprefix.stripprefix.prefixes=/tty2"
- "traefik.http.middlewares.tty2-stripprefix.stripprefix.prefixes=/{{ showroom_random_path }}/tty2"
- "traefik.http.middlewares.tty2theader.headers.customrequestheaders.X-Content-Type-Options=false"
2 changes: 1 addition & 1 deletion ansible/roles/showroom/templates/service_tty2/tab_tty2.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div id="tty2_tab" class="tabcontent">
<iframe id="tty2" src="https://{{ showroom_host }}:{{ showroom_primary_port }}/tty2/" width="100%" style="border:none;"></iframe>
<iframe id="tty2" src="https://{{ showroom_host }}:{{ showroom_primary_port }}/{{ showroom_random_path }}/tty2/" width="100%" style="border:none;"></iframe>
</div>
Loading