From a75a0c8722bf290db5ba827364717fe672a3f2bc Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Tue, 11 Nov 2025 03:51:38 +0100 Subject: [PATCH] Access node parameters through node instead of directly --- patches/hostname.yaml | 2 +- patches/install-disk.yaml | 2 +- patches/network.yaml | 6 +++--- patches/vip.yaml | 4 ++-- tools/render | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/patches/hostname.yaml b/patches/hostname.yaml index 3ec9799..6c712ba 100644 --- a/patches/hostname.yaml +++ b/patches/hostname.yaml @@ -1,3 +1,3 @@ machine: network: - hostname: {{hostname}} + hostname: {{node.hostname}} diff --git a/patches/install-disk.yaml b/patches/install-disk.yaml index 4868f57..3a2da3d 100644 --- a/patches/install-disk.yaml +++ b/patches/install-disk.yaml @@ -1,3 +1,3 @@ machine: install: - disk: {{installDisk}} + disk: {{node.installDisk}} diff --git a/patches/network.yaml b/patches/network.yaml index 936eecf..70529c5 100644 --- a/patches/network.yaml +++ b/patches/network.yaml @@ -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}} diff --git a/patches/vip.yaml b/patches/vip.yaml index e84c4a1..32b4d5a 100644 --- a/patches/vip.yaml +++ b/patches/vip.yaml @@ -1,6 +1,6 @@ machine: network: interfaces: - - interface: {{interface}} + - interface: {{node.interface}} vip: - ip: {{cluster.controlPlaneIp}} + ip: {{node.cluster.controlPlaneIp}} diff --git a/tools/render b/tools/render index 3c0d385..3c5706f 100755 --- a/tools/render +++ b/tools/render @@ -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