From ee88cc15b87221ecabb474c7c3d0feaf6e01a7fa Mon Sep 17 00:00:00 2001 From: Hollie Hutchinson Date: Sat, 1 Nov 2025 15:19:37 +0000 Subject: [PATCH] Remove MAC address requirement for node registration Allow the creation of baremetal nodes without specifying any NICs. In this case switch the target provision state from available to enroll. We're proposing this patch to support enrolling nodes as a first step before running an out-of-band Redfish inspection to get the NICs. No change is made to existing workflows. Change-Id: I9b1636d778e7477191bfbe6094bd6bc70a4d384e Signed-off-by: Hollie Hutchinson Signed-off-by: Doug Szumski --- plugins/modules/baremetal_node.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/modules/baremetal_node.py b/plugins/modules/baremetal_node.py index 1f111040..c75533c5 100644 --- a/plugins/modules/baremetal_node.py +++ b/plugins/modules/baremetal_node.py @@ -75,7 +75,10 @@ options: description: - 'A list of network interface cards, eg, C( - mac: aa:bb:cc:aa:bb:cc)' - This node attribute cannot be updated. - required: true + - If this option is not set, the target provision state of the node + changes from available to enroll. + required: false + default: [] type: list elements: dict suboptions: @@ -508,7 +511,7 @@ class BaremetalNodeModule(OpenStackModule): management_interface=dict(), name=dict(), network_interface=dict(), - nics=dict(type='list', required=True, elements='dict'), + nics=dict(type='list', default=[], elements='dict'), power_interface=dict(), properties=dict( type='dict', @@ -655,6 +658,8 @@ class BaremetalNodeModule(OpenStackModule): nics=self.params['nics'], wait=self.params['wait'], timeout=self.params['timeout'], + provision_state=( + 'available' if len(self.params['nics']) > 0 else 'enroll'), **kwargs) self.exit_json(changed=True, node=node.to_dict(computed=False))