From 685bb0bb10745e883c2afee7dcf7027dc7e969b6 Mon Sep 17 00:00:00 2001 From: Charles Treatman Date: Thu, 3 Oct 2024 16:02:53 -0500 Subject: [PATCH] fix parameter definitions for reserved IP blocks --- docs/modules/metal_reserved_ip_block.md | 2 ++ plugins/modules/metal_reserved_ip_block.py | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/modules/metal_reserved_ip_block.md b/docs/modules/metal_reserved_ip_block.md index 965181d..79ac5e9 100644 --- a/docs/modules/metal_reserved_ip_block.md +++ b/docs/modules/metal_reserved_ip_block.md @@ -53,6 +53,8 @@ When a user provisions first device in a facility, Equinix Metal API automatical | `customdata` |
`str`
|
Optional
| Custom data to associate with the reserved IP block | | `comments` |
`str`
|
Optional
| Comments to associate with the reserved IP block | | `vrf_id` |
`str`
|
Optional
| The ID of the VRF in which this VRF IP Reservation is created. The VRF must have an existing IP Range that contains the requested subnet. | +| `network` |
`str`
|
Optional
| The starting address for this VRF IP Reservation's subnet. Both IPv4 and IPv6 are supported. | +| `cidr` |
`int`
|
Optional
| The size of the VRF IP Reservation's subnet. The following subnet sizes are supported:
- IPv4: between 22 - 29 inclusive
- IPv6: exactly 64 | | `project_id` |
`str`
|
Optional
| The ID of the project to which the reserved IP block will be assigned | | `tags` |
`list`
|
Optional
| Tags to associate with the reserved IP block | diff --git a/plugins/modules/metal_reserved_ip_block.py b/plugins/modules/metal_reserved_ip_block.py index c7d5671..b59b46d 100644 --- a/plugins/modules/metal_reserved_ip_block.py +++ b/plugins/modules/metal_reserved_ip_block.py @@ -220,6 +220,14 @@ 'The VRF must have an existing IP Range that contains the requested subnet.', ], ), + network=SpecField( + type=FieldType.string, + description=['''The starting address for this VRF IP Reservation's subnet. Both IPv4 and IPv6 are supported.'''], + ), + cidr=SpecField( + type=FieldType.integer, + description=['''The size of the VRF IP Reservation's subnet. The following subnet sizes are supported:
- IPv4: between 22 - 29 inclusive
- IPv6: exactly 64'''], + ), project_id=SpecField( type=FieldType.string, description=['The ID of the project to which the reserved IP block will be assigned'], @@ -278,10 +286,12 @@ def main(): # argument_spec=argument_spec, argument_spec=SPECDOC_META.ansible_spec, required_one_of=[['id', 'project_id']], - required_by=dict(project_id=['quantity', 'type']), + required_by=dict(project_id=['type']), required_if=[ ['type', 'vrf', ['vrf_id', 'cidr', 'network']], - ['type', 'public_ipv4', ['metro']] + ['type', 'public_ipv4', ['quantity', 'metro']], + ['type', 'private_ipv4', ['quantity']], + ['type', 'global_ipv4', ['quantity']] ], )