From 31c976ae4969ceb2891fd6642fe703e33d36efbc Mon Sep 17 00:00:00 2001 From: sbyrnes Date: Mon, 4 Mar 2024 10:36:05 -0600 Subject: [PATCH] Create gen-topo.py --- internal-lab-setup-assets/gen-topo.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 internal-lab-setup-assets/gen-topo.py diff --git a/internal-lab-setup-assets/gen-topo.py b/internal-lab-setup-assets/gen-topo.py new file mode 100644 index 0000000..278fea9 --- /dev/null +++ b/internal-lab-setup-assets/gen-topo.py @@ -0,0 +1,16 @@ +#!/usr/bin/python +import jinja2 + +# Recreated from scratch in 02/2024 + +TEMPLATE_FILE = "workshop.clab.yml.j2" +NUM_LABS = 30 + +templateLoader = jinja2.FileSystemLoader(searchpath="./") +templateEnv = jinja2.Environment(loader=templateLoader) +template = templateEnv.get_template(TEMPLATE_FILE) + +for i in range(1, NUM_LABS + 1): + with open(f"workshop{i}.clab.yml", "w") as f: + outputText = template.render(id=i) + f.write(outputText)