diff --git a/plugins/modules/metal_reserved_ip_block.py b/plugins/modules/metal_reserved_ip_block.py index 1854232..25414aa 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: