Skip to content

Commit

Permalink
feat: metal vrf documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonin Rykalsky committed Nov 27, 2023
1 parent b6507d1 commit 096b424
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Name | Description |
[equinix.cloud.metal_reserved_ip_block](./docs/modules/metal_reserved_ip_block.md)|Create/delete blocks of reserved IP addresses in a project.|
[equinix.cloud.metal_ssh_key](./docs/modules/metal_ssh_key.md)|Manage personal SSH keys in Equinix Metal|
[equinix.cloud.metal_vlan](./docs/modules/metal_vlan.md)|Manage a VLAN resource in Equinix Metal|
[equinix.cloud.metal_vrf](./docs/modules/metal_vrf.md)|Use this resource to manage a VRF.|


### Info Modules
Expand Down
98 changes: 98 additions & 0 deletions docs/modules/metal_vrf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# metal_vrf

Create a VRF in your desired metro and project with any IP ranges that you want the VRF to route and forward.


- [Examples](#examples)
- [Parameters](#parameters)
- [Return Values](#return-values)

## Examples

```yaml
- name: Create new Equinix Metal VRF
hosts: localhost
tasks:
- equinix.cloud.metal_vrf:
name: "example-vrf"
description: "VRF with ASN 65000 and a pool of address space that includes 192.168.100.0/25"
metro: "da"
local_asn: 65000
ip_ranges:
- "192.168.100.0/25"
- "192.168.200.0/25"
project_id: "your_project_id_here"

```










## Parameters

| Field | Type | Required | Description |
|-----------|------|----------|------------------------------------------------------------------------------|
| `id` | <center>`str`</center> | <center>Optional</center> | UUID of the VRF. |
| `description` | <center>`str`</center> | <center>Optional</center> | Description of the VRF. |
| `name` | <center>`str`</center> | <center>Optional</center> | User-supplied name of the VRF, unique to the project. |
| `metro` | <center>`str`</center> | <center>Optional</center> | Metro ID or Code where the VRF will be deployed. |
| `local_asn` | <center>`int`</center> | <center>Optional</center> | The 4-byte ASN set on the VRF. |
| `ip_ranges` | <center>`list`</center> | <center>Optional</center> | All IPv4 and IPv6 Ranges that will be available to BGP Peers. IPv4 addresses must be /8 or smaller with a minimum size of /29. IPv6 must be /56 or smaller with a minimum size of /64. Ranges must not overlap other ranges within the VRF. |
| `project_id` | <center>`str`</center> | <center>Optional</center> | Project ID where the VRF will be deployed. |






## Return Values

- `metal_vrf` - The module object

- Sample Response:
```json

{
"changed": false,
"description": "Test VRF with ASN 65000",
"id": "f4a7863c-fcbf-419c-802c-3c6d3ad9529e",
"invocation": {
"module_args": {
"description": null,
"id": "f4a7863c-fcbf-419c-802c-3c6d3ad9529e",
"ip_ranges": [
"192.168.100.0/25",
"192.168.200.0/25"
],
"local_asn": 65000,
"metal_api_token": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"metal_api_url": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"metal_ua_prefix": "",
"metro": "am",
"name": "ansible-integration-test-vrf-6yww6pyz",
"project_id": "9934e474-04a1-46a3-842b-5f3dc0ed0eba",
"state": "present"
}
},
"ip_ranges": [
"192.168.100.0/25",
"192.168.200.0/25"
],
"local_asn": 65000,
"metro": {
"href": "/metal/v1/locations/metros/108b2cfb-246b-45e3-885a-bf3e82fce1a0",
"id": "108b2cfb-246b-45e3-885a-bf3e82fce1a0"
},
"name": "ansible-integration-test-vrf-6yww6pyz",
"project_id": "9934e474-04a1-46a3-842b-5f3dc0ed0eba"
}

```


88 changes: 85 additions & 3 deletions plugins/modules/metal_vrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,91 @@
# DOCUMENTATION, EXAMPLES, and RETURN are generated by
# ansible_specdoc. Do not edit them directly.

DOCUMENTATION = ""
EXAMPLES = ""
RETURN = ""
DOCUMENTATION = '''
author: Equinix DevRel Team (@equinix) <support@equinix.com>
description: Create a VRF in your desired metro and project with any IP ranges that
you want the VRF to route and forward.
module: metal_vrf
notes: []
options:
description:
description:
- Description of the VRF.
required: false
type: str
id:
description:
- UUID of the VRF.
required: false
type: str
ip_ranges:
description:
- All IPv4 and IPv6 Ranges that will be available to BGP Peers. IPv4 addresses
must be /8 or smaller with a minimum size of /29. IPv6 must be /56 or smaller
with a minimum size of /64. Ranges must not overlap other ranges within the
VRF.
required: false
type: list
local_asn:
description:
- The 4-byte ASN set on the VRF.
required: false
type: int
metro:
description:
- Metro ID or Code where the VRF will be deployed.
required: false
type: str
name:
description:
- User-supplied name of the VRF, unique to the project.
required: false
type: str
project_id:
description:
- Project ID where the VRF will be deployed.
required: false
type: str
requirements: null
short_description: Use this resource to manage a VRF.
'''
EXAMPLES = '''
- name: Create new Equinix Metal VRF
hosts: localhost
tasks:
- equinix.cloud.metal_vrf:
name: example-vrf
description: VRF with ASN 65000 and a pool of address space that includes 192.168.100.0/25
metro: da
local_asn: 65000
ip_ranges:
- 192.168.100.0/25
- 192.168.200.0/25
project_id: your_project_id_here
'''
RETURN = '''
metal_vrf:
description: The module object
returned: always
sample:
- "\n{\n \"changed\": false,\n \"description\": \"Test VRF with ASN 65000\"\
,\n \"id\": \"f4a7863c-fcbf-419c-802c-3c6d3ad9529e\",\n \"invocation\":\
\ {\n \"module_args\": {\n \"description\": null,\n \
\ \"id\": \"f4a7863c-fcbf-419c-802c-3c6d3ad9529e\",\n \"ip_ranges\"\
: [\n \"192.168.100.0/25\",\n \"192.168.200.0/25\"\
\n ],\n \"local_asn\": 65000,\n \"metal_api_token\"\
: \"VALUE_SPECIFIED_IN_NO_LOG_PARAMETER\",\n \"metal_api_url\": \"\
VALUE_SPECIFIED_IN_NO_LOG_PARAMETER\",\n \"metal_ua_prefix\": \"\"\
,\n \"metro\": \"am\",\n \"name\": \"ansible-integration-test-vrf-6yww6pyz\"\
,\n \"project_id\": \"9934e474-04a1-46a3-842b-5f3dc0ed0eba\",\n \
\ \"state\": \"present\"\n }\n },\n \"ip_ranges\": [\n \
\ \"192.168.100.0/25\",\n \"192.168.200.0/25\"\n ],\n \"local_asn\"\
: 65000,\n \"metro\": {\n \"href\": \"/metal/v1/locations/metros/108b2cfb-246b-45e3-885a-bf3e82fce1a0\"\
,\n \"id\": \"108b2cfb-246b-45e3-885a-bf3e82fce1a0\"\n },\n \"name\"\
: \"ansible-integration-test-vrf-6yww6pyz\",\n \"project_id\": \"9934e474-04a1-46a3-842b-5f3dc0ed0eba\"\
\n}\n"
type: dict
'''

# End of generated documentation

Expand Down

0 comments on commit 096b424

Please sign in to comment.