From a936f0f0ee5920c1d158f1f76e06f112f56dbe17 Mon Sep 17 00:00:00 2001 From: karmab Date: Tue, 28 Nov 2023 12:59:13 +0100 Subject: [PATCH] ztp: dont create more bmh objects than total spoke ocp nodes --- ztp/scripts/bmc.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ztp/scripts/bmc.yml b/ztp/scripts/bmc.yml index 56415d98..51a025c5 100644 --- a/ztp/scripts/bmc.yml +++ b/ztp/scripts/bmc.yml @@ -6,6 +6,7 @@ {% set spoke = ztp_spokes[index] %} {% set spoke_name = spoke.name %} {% set virtual_nodes_number = spoke["virtual_nodes_number"]|default(0) %} +{% set ocp_nodes_number = spoke["ctlplanes_number"]|default(0) + spoke["workers_number"]|default(0)%} {% set nodes = spoke["nodes"]|default([]) %} {% if virtual_nodes_number > 0 %} @@ -19,6 +20,9 @@ --- {% for node in nodes %} {% set num = loop.index0 %} +{% if num > ocp_nodes_number %} +{{ continue }} +{% endif %} apiVersion: v1 data: password: {{ bmc_password|string|base64 }}