From 9834cccde24de733007c7cba74f08f372eaf254f Mon Sep 17 00:00:00 2001 From: sbyrnes Date: Mon, 4 Mar 2024 10:36:29 -0600 Subject: [PATCH] Create gen-topo.py --- internal-lab-setup-assets/gen-topo.py | 14 ++++++++++++++ 1 file changed, 14 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..4bab5ed --- /dev/null +++ b/internal-lab-setup-assets/gen-topo.py @@ -0,0 +1,14 @@ +#!/usr/bin/python +import jinja2 + +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)