Open t0mk opened 1 year ago
This is a Terraform-ism that we potentially don't need if the ports are made to be configurable in the Metal Device.
This is a Terraform-ism that we potentially don't need if the ports are made to be configurable in the Metal Device.
The metal_device module doesn't seem to support port configuration. Should we add port configuration support to metal_device or add a separate metal_port module? In its current state, the Ansible collection cannot be used to put a device in L2 mode.
After thinking more about this, the /ports* APIs are a feature all their own and they have (potential) use beyond devices.
Looking at the TF provider, I think the module would look like:
tasks:
- equinix.cloud.metal_port:
port_id: "3b516842-c8b1-485e-9f76-c891bd804c5e" # required lookup
bonded: true/false
layer2: true/false # valid only on bond ports
vxlan_ids: [1234, 5678]
vlans_ids: [uuid, uuid]
reset_on_delete: true/false # ansible behavior
# read-only
name: bond0
network_type: layer2-individual
type: NetworkBondPort
mac: ...
bond_id: ...
bond_name: ...
disbond_supported: ...
Inventory would return the same based on port_id.
There may be other considerations from a purely API spec view.
Create module for metal_port.
Analogical to resource equinix_metal_port in terraform-provider-equinix:
Module should
plugins/modules/metal_port.py
check_mode
if it's an_info
modulemake docs
)tests/integration/targets/metal_port/tasks/main.yml
$ cd .ansible/collections/ansible_collections/equinix/cloud
$ ansible-test sanity -v --docker --python 3.10 metal_port.py
See the newest added module to get an idea how to do implement this.