Skip to content

Commit

Permalink
fix: support multiple reserved IP blocks of same type in a metro (#240)
Browse files Browse the repository at this point in the history
This uses the `network` attribute, if it is specified in the task
config, to differentiate between different IP reservations of the same
type in the same metro.

Fixes #235
  • Loading branch information
cprivitere authored Oct 17, 2024
2 parents 87bc41e + 2c578f2 commit eefa7e7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/modules/metal_reserved_ip_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit eefa7e7

Please sign in to comment.