Access node parameters through node instead of directly

This commit is contained in:
2025-11-11 03:51:38 +01:00
parent 2dda3cc465
commit a75a0c8722
5 changed files with 8 additions and 8 deletions

View File

@@ -1,3 +1,3 @@
machine:
network:
hostname: {{hostname}}
hostname: {{node.hostname}}

View File

@@ -1,3 +1,3 @@
machine:
install:
disk: {{installDisk}}
disk: {{node.installDisk}}

View File

@@ -1,10 +1,10 @@
machine:
network:
interfaces:
- interface: {{interface}}
- interface: {{node.interface}}
dhcp: false
addresses:
- {{ip}}
- {{node.ip}}
routes:
- network: 0.0.0.0/0
gateway: {{gateway}}
gateway: {{node.gateway}}

View File

@@ -1,6 +1,6 @@
machine:
network:
interfaces:
- interface: {{interface}}
- interface: {{node.interface}}
vip:
ip: {{cluster.controlPlaneIp}}
ip: {{node.cluster.controlPlaneIp}}

View File

@@ -41,7 +41,7 @@ def render_templates(node: dict, args: dict):
def default(self, o):
if isinstance(o, Template):
try:
rendered = o.render(args | node)
rendered = o.render(args | {"node": node})
except Exception as e:
e.add_note(f"While rendering for: {node['hostname']}")
raise e