Compare commits
2 Commits
b0e146241b
...
dac2864b2d
| Author | SHA1 | Date | |
|---|---|---|---|
|
dac2864b2d
|
|||
|
85368a3126
|
@@ -2,7 +2,6 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
ROOT=$(git rev-parse --show-toplevel)
|
ROOT=$(git rev-parse --show-toplevel)
|
||||||
CONFIGS=${ROOT}/configs
|
CONFIGS=${ROOT}/configs
|
||||||
TALOSCONFIG=${CONFIGS}/talosconfig
|
|
||||||
|
|
||||||
# Generate the configuration for each node
|
# Generate the configuration for each node
|
||||||
{% set clusters = [] %}
|
{% set clusters = [] %}
|
||||||
@@ -36,6 +35,7 @@ talosctl gen config {{ cluster[0] }} https://{{ cluster[1] }}:6443 -f \
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
# Create merged talosconfig
|
# Create merged talosconfig
|
||||||
|
export TALOSCONFIG=${CONFIGS}/talosconfig
|
||||||
rm -f ${TALOSCONFIG}
|
rm -f ${TALOSCONFIG}
|
||||||
{% for cluster in clusters|unique -%}
|
{% for cluster in clusters|unique -%}
|
||||||
talosctl config merge ${CONFIGS}/{{ cluster[0] }}/talosconfig
|
talosctl config merge ${CONFIGS}/{{ cluster[0] }}/talosconfig
|
||||||
|
|||||||
10
tools/render
10
tools/render
@@ -124,10 +124,10 @@ def main():
|
|||||||
yml_data["filename"] = filename
|
yml_data["filename"] = filename
|
||||||
nodes.append(yml_data)
|
nodes.append(yml_data)
|
||||||
|
|
||||||
final_nodes = []
|
# Quick and dirty way to resolve all the templates using a custom encoder
|
||||||
for node in nodes:
|
nodes = list(
|
||||||
# Quick and dirty way to resolve all the templates using a custom encoder
|
map(lambda node: json.loads(json.dumps(node, cls=node_encoder(node))), nodes)
|
||||||
final_nodes.append(json.loads(json.dumps(node, cls=node_encoder(node))))
|
)
|
||||||
|
|
||||||
with open(ROOT.joinpath("config.yaml")) as fyaml:
|
with open(ROOT.joinpath("config.yaml")) as fyaml:
|
||||||
config = yaml.safe_load(fyaml)
|
config = yaml.safe_load(fyaml)
|
||||||
@@ -136,7 +136,7 @@ def main():
|
|||||||
for template_name in TEMPLATES.list_templates():
|
for template_name in TEMPLATES.list_templates():
|
||||||
template = TEMPLATES.get_template(template_name)
|
template = TEMPLATES.get_template(template_name)
|
||||||
|
|
||||||
rendered = template.render(nodes=final_nodes, config=config)
|
rendered = template.render(nodes=nodes, config=config)
|
||||||
with open(RENDERED.joinpath(template_name), "w") as f:
|
with open(RENDERED.joinpath(template_name), "w") as f:
|
||||||
f.write(rendered)
|
f.write(rendered)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user