equinix-labs / ansible-collection-equinix

Ansible content to help automate the management of Equinix resources
https://deploy.equinix.com/labs/ansible-collection-equinix/
GNU General Public License v3.0
2 stars 8 forks source link

metal_port #61

Open t0mk opened 1 year ago

t0mk commented 1 year ago

Create module for metal_port.

Analogical to resource equinix_metal_port in terraform-provider-equinix:

Module should

See the newest added module to get an idea how to do implement this.

displague commented 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.

ctreatma commented 3 months ago

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.

displague commented 3 months ago

After thinking more about this, the /ports* APIs are a feature all their own and they have (potential) use beyond devices.

displague commented 3 months ago

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.