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
2 changes: 2 additions & 0 deletions .cp/copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ lab_features:
- git
- slides
- addAliases
- graphite
- terminals

lab_author:
type: str
Expand Down
3 changes: 0 additions & 3 deletions .cp/extra-vars/atd-l3ls/lab_host_inventory.csv

This file was deleted.

20 changes: 11 additions & 9 deletions .cp/extra-vars/atd-l3ls/lab_inventory.csv
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
hostname,mgmt_ip
dc1-spine1,172.16.1.11
dc1-spine2,172.16.1.12
dc1-leaf1a,172.16.1.101
dc1-leaf1b,172.16.1.102
dc1-leaf2a,172.16.1.103
dc1-leaf2b,172.16.1.104
dc1-leaf1c,172.16.1.151
dc1-leaf2c,172.16.1.152
hostname,mgmt_ip,role,platform
dc1-spine1,172.16.1.11,spine,ceos
dc1-spine2,172.16.1.12,spine,ceos
dc1-leaf1a,172.16.1.101,leaf,ceos
dc1-leaf1b,172.16.1.102,leaf,ceos
dc1-leaf2a,172.16.1.103,leaf,ceos
dc1-leaf2b,172.16.1.104,leaf,ceos
dc1-leaf1c,172.16.1.151,leaf,ceos
dc1-leaf2c,172.16.1.152,leaf,ceos
dc1-leaf1-server1,172.16.1.201,host,ceos
dc1-leaf2-server1,172.16.1.202,host,ceos
3 changes: 0 additions & 3 deletions .cp/extra-vars/default/lab_host_inventory.csv

This file was deleted.

16 changes: 9 additions & 7 deletions .cp/extra-vars/default/lab_inventory.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
hostname,mgmt_ip
s01,10.0.1.1
s02,10.0.1.2
l01,10.0.2.1
l02,10.0.2.2
l03,10.0.2.3
l04,10.0.2.4
hostname,mgmt_ip,role,platform,terminals_icon,terminals_color,terminals_split
s01,10.0.1.1,spine,ceos
s02,10.0.1.2,spine,ceos,,,s01
l01,10.0.2.1,leaf,ceos,bookmark,terminal.ansiRed
l02,10.0.2.2,leaf,ceos,bookmark,terminal.ansiRed,l01
l03,10.0.2.3,leaf,ceos,,terminal.ansiGreen
l04,10.0.2.4,leaf,ceos,,terminal.ansiGreen,l03
h01,10.0.3.1,host,ceos
h02,10.0.3.2,host,ceos
2 changes: 0 additions & 2 deletions .cp/extra-vars/minimalistic-l3ls-aa/lab_host_inventory.csv

This file was deleted.

11 changes: 6 additions & 5 deletions .cp/extra-vars/minimalistic-l3ls-aa/lab_inventory.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
hostname,mgmt_ip
s01,10.0.1.1
s02,10.0.1.2
l01,10.0.2.1
l02,10.0.2.2
hostname,mgmt_ip,role,platform
s01,10.0.1.1,spine,ceos
s02,10.0.1.2,spine,ceos
l01,10.0.2.1,leaf,ceos
l02,10.0.2.2,leaf,ceos
h01,10.0.3.1,host,ceos
2 changes: 0 additions & 2 deletions .cp/extra-vars/minimalistic-l3ls-mlag/lab_host_inventory.csv

This file was deleted.

11 changes: 6 additions & 5 deletions .cp/extra-vars/minimalistic-l3ls-mlag/lab_inventory.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
hostname,mgmt_ip
s01,10.0.1.1
s02,10.0.1.2
l01,10.0.2.1
l02,10.0.2.2
hostname,mgmt_ip,role,platform
s01,10.0.1.1,spine,ceos
s02,10.0.1.2,spine,ceos
l01,10.0.2.1,leaf,ceos
l02,10.0.2.2,leaf,ceos
h01,10.0.3.1,host,ceos
3 changes: 0 additions & 3 deletions .cp/extra-vars/small-l3ls-aa/lab_host_inventory.csv

This file was deleted.

16 changes: 9 additions & 7 deletions .cp/extra-vars/small-l3ls-aa/lab_inventory.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
hostname,mgmt_ip
s01,10.0.1.1
s02,10.0.1.2
l01,10.0.2.1
l02,10.0.2.2
l03,10.0.2.3
l04,10.0.2.4
hostname,mgmt_ip,role,platform
s01,10.0.1.1,spine,ceos
s02,10.0.1.2,spine,ceos
l01,10.0.2.1,leaf,ceos
l02,10.0.2.2,leaf,ceos
l03,10.0.2.3,leaf,ceos
l04,10.0.2.4,leaf,ceos
h01,10.0.3.1,host,ceos
h02,10.0.3.2,host,ceos
3 changes: 0 additions & 3 deletions .cp/extra-vars/small-l3ls-mlag/lab_host_inventory.csv

This file was deleted.

16 changes: 9 additions & 7 deletions .cp/extra-vars/small-l3ls-mlag/lab_inventory.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
hostname,mgmt_ip
s01,10.0.1.1
s02,10.0.1.2
l01,10.0.2.1
l02,10.0.2.2
l03,10.0.2.3
l04,10.0.2.4
hostname,mgmt_ip,role,platform
s01,10.0.1.1,spine,ceos
s02,10.0.1.2,spine,ceos
l01,10.0.2.1,leaf,ceos
l02,10.0.2.2,leaf,ceos
l03,10.0.2.3,leaf,ceos
l04,10.0.2.4,leaf,ceos
h01,10.0.3.1,host,ceos
h02,10.0.3.2,host,ceos
9 changes: 3 additions & 6 deletions .cp/include/docs/lab-how-to-run.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,10 @@ To run the lab on your own machine, you can download all required files using th

This lab has following devices:

| Hostname | Type | OS | Management Address | Username | Password |
| -------- | ---- | -- | ------------------ | -------- | -------- |
| Hostname | Role | Platform | OS Version | Management Address | Username | Password |
| -------- | ---- | -------- | -----------| ------------------ | -------- | -------- |
{%- for node in lab_inventory %}
| {{ node.hostname }} | switch | cEOS-lab, {{ ceos_lab_version }} | {{ node.mgmt_ip }} | {{ clab_user }} | {{ clab_password }} |
{%- endfor %}
{%- for node in lab_host_inventory %}
| {{ node.hostname }} | host | cEOS-lab, {{ ceos_lab_version }} | {{ node.mgmt_ip }} | {{ clab_user }} | {{ clab_password }} |
| {{ node.hostname }} | {{ node.role }} | {{ node.platform }} | {{ ceos_lab_version }} | {{ node.mgmt_ip }} | {{ clab_user }} | {{ clab_password }} |
{%- endfor %}

> To access any device, use `ssh <username>@<hostname>` or simply type `<hostname>` to use the SSH alias.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ Please check the lab materials:

This lab has following devices:

| Hostname | Type | OS | Management Address | Username | Password |
| -------- | ---- | -- | ------------------ | -------- | -------- |
| Hostname | Role | Platform | OS Version | Management Address | Username | Password |
| -------- | ---- | -------- | -----------| ------------------ | -------- | -------- |
{%- for node in lab_inventory %}
| {{ node.hostname }} | switch | cEOS-lab, {{ ceos_lab_version }} | {{ node.mgmt_ip }} | {{ clab_user }} | {{ clab_password }} |
{%- endfor %}
{%- for node in lab_host_inventory %}
| {{ node.hostname }} | host | cEOS-lab, {{ ceos_lab_version }} | {{ node.mgmt_ip }} | {{ clab_user }} | {{ clab_password }} |
| {{ node.hostname }} | {{ node.role }} | {{ node.platform }} | {{ ceos_lab_version }} | {{ node.mgmt_ip }} | {{ clab_user }} | {{ clab_password }} |
{%- endfor %}

> To access any device, use `ssh <username>@<hostname>` or simply type `<hostname>` to use the SSH alias.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@
set +e
{%- for node in lab_inventory %}
echo "alias {{ node.hostname }}='sshpass -p {{ clab_password }} ssh -o \"StrictHostKeyChecking no\" {{ clab_user }}@{{ node.mgmt_ip }}'" >> ~/.zshrc
{%- endfor %}
{%- for node in lab_host_inventory %}
echo "alias {{ node.hostname }}='sshpass -p {{ clab_password }} ssh -o \"StrictHostKeyChecking no\" {{ clab_user }}@{{ node.mgmt_ip }}'" >> ~/.zshrc
{%- endfor %}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ vrf instance MGMT
ip name-server vrf MGMT 8.8.8.8
dns domain avd.lab
!
platform tfa
personality arfa
!
ntp local-interface vrf MGMT Management0
ntp server vrf MGMT time.apple.com
ntp server vrf MGMT time.google.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@ topology:
{%- for node in lab_inventory %}
{{ node.hostname }}:
mgmt-ipv4: {{ node.mgmt_ip }}
{%- if node.role in ['spine','leaf'] %}
binds:
- sn/{{ node.hostname }}.txt:/mnt/flash/ceos-config:ro
startup-config: init-configs/{{ node.hostname }}.cfg
{%- endfor %}
{%- for node in lab_host_inventory %}
{{ node.hostname }}:
mgmt-ipv4: {{ node.mgmt_ip }}
{%- endif %}
startup-config: init-configs/{{ node.hostname }}.cfg
{%- endfor %}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{% raw %}{{% endraw %}
"autorun": true,
"autokill": true,
"env": {% raw %}{{% endraw %}
"TERMINAL_READY_MESSAGE": "Please check the README.md and the lab documentation before using the lab.",
"TERMINAL_SHELL": "bash",
"TERMINAL_STATUS_COMMAND": "Cli -p 15 -c 'show version'",
"TERMINAL_READY_COMMAND": "Cli -p 15"
{% raw %}},{% endraw %}
"terminals": {% raw %}[{% endraw %}
{%- for node in lab_inventory %}
{% raw %}{{% endraw %}
"name": "{{ node.hostname }}",
{%- if node.terminals_description | default(false, true) %}
"description": "{{ node.terminals_description | default("", true) }}",
{%- endif %}
{%- if node.terminals_icon is defined %}
"icon": "{{ node.terminals_icon | default("code", true) }}",
{%- endif %}
{%- if node.terminals_color | default(false, true) %}
"color": "{{ node.terminals_color }}",
{%- endif %}
{%- if node.terminals_split | default(false, true) %}
"split": "{{ node.terminals_split }}",
{%- endif %}
"command": "terminals.sh {{ node.hostname }}",
"recycle": false,
"open": true,
"focus": true
{%- if not loop.last %}
{% raw %}},{% endraw %}
{%- else %}
{% raw %}}{% endraw %}
{%- endif %}
{%- endfor %}
{% raw %}]{% endraw %}
{% raw %}}{% endraw %}
4 changes: 3 additions & 1 deletion .github/workflows/container_build_parent_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ jobs:
from_variant: ${{ matrix.from_variant }}
clab_version: ${{ matrix.clab_version }}
# the rev number will be updated with each run
container_revision: "1.1"
# 1.1 - initial version
# 1.2 - added fabiospampinato.vscode-terminals extension
container_revision: "1.2"
4 changes: 4 additions & 0 deletions containers/dev/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"oderwat.indent-rainbow",
"AykutSarac.jsoncrack-vscode",
"hilleer.yaml-plus-json",
// spell checker
"streetsidesoftware.code-spell-checker",
// marp preview extension
"marp-team.marp-vscode",
// errors and highlighters
Expand All @@ -28,6 +30,8 @@
"yzhang.markdown-all-in-one",
"bierner.markdown-checkbox",
"DavidAnson.vscode-markdownlint",
// jinja
"samuelcolvin.jinjahtml",
// various tools
"tuxtina.json2yaml",
"mutantdino.resourcemonitor"
Expand Down
3 changes: 3 additions & 0 deletions containers/lab-base/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ RUN apt-get update \
# copy postCreate script
COPY ./postCreate.sh /bin/postCreate.sh
RUN chmod +x /bin/postCreate.sh
# copy terminals script
COPY ./terminals.sh /bin/terminals.sh
RUN chmod +x /bin/terminals.sh

USER ${USERNAME}

Expand Down
4 changes: 3 additions & 1 deletion containers/lab-base/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"DavidAnson.vscode-markdownlint",
// various tools
"tuxtina.json2yaml",
"mutantdino.resourcemonitor"
"mutantdino.resourcemonitor",
// terminals manager
"fabiospampinato.vscode-terminals"
]
}
}
Expand Down
17 changes: 17 additions & 0 deletions containers/lab-base/.devcontainer/terminals.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# This script requires VSCode `fabiospampinato.vscode-terminals` extension
# The script will wait for docker exec to be ready before making the terminal available to user input

clear
echo 'Waiting for the lab to start...'
until docker exec -it $1 ${TERMINAL_SHELL} -c "${TERMINAL_STATUS_COMMAND} 2> /dev/null" >/dev/null 2>&1; do
sleep 5
done
clear
echo "$1 is ready."
# Print additional instructions for the user if env var is set
if [ "${TERMINAL_READY_MESSAGE}" ]; then
echo ${TERMINAL_READY_MESSAGE}
fi
docker exec -it $1 ${TERMINAL_READY_COMMAND}
Loading