From a3bc5860581a93112d87a28a1750fb8eb47e4d43 Mon Sep 17 00:00:00 2001 From: Charles Treatman Date: Wed, 9 Oct 2024 14:22:10 -0500 Subject: [PATCH] support multiple reserved IP blocks of same type in a metro --- plugins/modules/metal_reserved_ip_block.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/modules/metal_reserved_ip_block.py b/plugins/modules/metal_reserved_ip_block.py index b59b46d..9e633b9 100644 --- a/plugins/modules/metal_reserved_ip_block.py +++ b/plugins/modules/metal_reserved_ip_block.py @@ -305,9 +305,14 @@ def main(): fetched = module.get_by_id("metal_ip_reservation", tolerate_not_found) else: module.params['types'] = [module.params.get('type')] + + attributes_to_compare = ["type", "metro"] + if module.params['network'] is not None: + attributes_to_compare.append("network") + fetched = module.get_one_from_list( "metal_ip_reservation", - ["type", "metro"], + attributes_to_compare, ) if fetched: