Compare commits
1 Commits
dac2864b2d
...
b0e146241b
| Author | SHA1 | Date | |
|---|---|---|---|
|
b0e146241b
|
@@ -2,6 +2,7 @@
|
|||||||
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 = [] %}
|
||||||
@@ -35,7 +36,6 @@ 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)
|
||||||
|
|
||||||
# Quick and dirty way to resolve all the templates using a custom encoder
|
final_nodes = []
|
||||||
nodes = list(
|
for node in nodes:
|
||||||
map(lambda node: json.loads(json.dumps(node, cls=node_encoder(node))), nodes)
|
# Quick and dirty way to resolve all the templates using a custom encoder
|
||||||
)
|
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=nodes, config=config)
|
rendered = template.render(nodes=final_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