Moved logic for getting clusters to render script

This commit is contained in:
2025-11-09 02:58:01 +01:00
parent eb36060ef5
commit 453d952b8f
2 changed files with 18 additions and 10 deletions

View File

@@ -134,6 +134,16 @@ def main():
)
)
# Get all clusterName & controlplaneIp pairs
clusters = map(
lambda node: {
"name": node["clusterName"],
"controlplaneIp": node["controlplaneIp"],
},
nodes,
)
clusters = [dict(s) for s in set(frozenset(d.items()) for d in clusters)]
with open(ROOT.joinpath("config.yaml")) as fyaml:
config = yaml.safe_load(fyaml)
@@ -141,7 +151,7 @@ def main():
for template_name in TEMPLATES.list_templates():
template = TEMPLATES.get_template(template_name)
rendered = template.render(nodes=nodes, config=config)
rendered = template.render(nodes=nodes, clusters=clusters, config=config)
with open(RENDERED.joinpath(template_name), "w") as f:
f.write(rendered)