michaelrigart / ansible-role-interfaces

An ansible role for configuring different network interfaces
GNU General Public License v3.0
83 stars 62 forks source link

error when configuring ip for a infiniband interface #76

Closed pescobar closed 2 years ago

pescobar commented 4 years ago

I have defined this variable to configure the ip for an infiniband interface:

  interfaces_ether_interfaces:
   - device: ib0 
     bootproto: static
     address: 10.41.0.10
     netmask: 255.255.128.0

but when running the playbook task Check active Ethernet interface state always reports a change for interface ib0 with this message:

changed: [login10] => (item={'device': 'ib0', 'bootproto': 'static', 'address': '10.41.0.10', 'netmask': '255.255.128.0'}) => {
    "msg": "Checking Ethernet interface configuration for ib0: {'diff': True, 'reason': 'Interface ib0 is of an unexpected type'}\n"
}

Later in handler Check active Ethernet interface state I get an error:

failed: [login10] (item={'device': 'ib0', 'bootproto': 'static', 'address': '10.41.0.10', 'netmask': '255.255.128.0'}) => {"ansible_loop_var": "item", "changed": false, "item": {"address": "10.41.0.10", "bootproto": "static", "device": "ib0", "netmask": "255.255.128.0"}, "msg": "Interface ib0 is of an unexpected type"}

The problem seems to be in here because for a regular ethernet interface fact["type"] = ether but for an infiniband interface fact["type"] = infiniband

Is it possible to add support to define interfaces_infiniband_interfaces? Or can I somehow define that the type for this interface is infiniband?

I can work on a PR or do beta-testing if you are open to add this feature to the role.

markgoddard commented 4 years ago

Hi Pablo. Given that interfaces_ether_interfaces explicitly states Ethernet, it would probably be less confusing to add interfaces_infiniband_interfaces than extend interfaces_ether_interfaces to support IB. I think it makes sense to add support.

Aethylred commented 2 years ago

Hasn't this been implemented with:

interfaces_ether_interfaces:
   - device: ib0 
     bootproto: static
     address: 10.41.0.10
     netmask: 255.255.128.0
     type: ipoib
pescobar commented 2 years ago

you are right it is solved in this PR https://github.com/michaelrigart/ansible-role-interfaces/pull/78

I am closing this issue.