From 235e5c956da366c7b923a8f73974af27b7ffc063 Mon Sep 17 00:00:00 2001 From: Erik Berg Date: Fri, 1 Apr 2022 14:03:00 +0200 Subject: [PATCH] Use key as name if not provided in inventory yaml We don't really need to specify the name of the host in the yaml if it's already be there in the key. YMMV. Change-Id: I82a11e1ae9b89f0426b1cc12923fb700406a873b --- bifrost/inventory.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bifrost/inventory.py b/bifrost/inventory.py index dfc91c67a..dc549eb5c 100755 --- a/bifrost/inventory.py +++ b/bifrost/inventory.py @@ -187,6 +187,9 @@ def _process_baremetal_data(data_source, groups, hostvars): continue host = file_data[name] + if 'name' not in host: + host['name'] = name + # Perform basic validation node_net_data = host.get('node_network_data') ipv4_addr = host.get('ipv4_address')