michaelrigart / ansible-role-interfaces

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

Adding IPoIB support #78

Closed pescobar closed 4 years ago

pescobar commented 4 years ago

This is an alternative approach to https://github.com/michaelrigart/ansible-role-interfaces/pull/77

With this change ipoib interfaces could be defined like this and it should work without duplicating any code (important detail is to use type: ipoib)

    interfaces_ether_interfaces:
      - device: eth0                                                                                                                                                                                                  
        bootproto: static                                                                                                                                                                                                    
        address: 192.168.1.22
        netmask: 255.255.255.0                                                                                                                                                                                                        
      - device: ib0                                                                                                                                                                                                  
        bootproto: static                                                                                                                                                                                                    
        address: 10.41.33.211                                                                                                                                                                                                          
        netmask: 255.255.128.0                                                                                                                                                                                                         
        type: ipoib                                                                                                                                                                                                           
pescobar commented 4 years ago

Personally I prefer this approach because it can reuse existing code without duplicating it and this seems easier to maintain in the future.

The only drawback I see is that ipoib interfaces are defined in var interfaces_ether_interfaces which is not very intuitive. But IMO configuring ipoib interfaces is not very common (will anyone besides me will use it? ;) and I prefer to just document this in the README instead of adding more complexity in the role (which already has enough hehehe)

markgoddard commented 4 years ago

Ok, let's go with this one. Please add an example to the README.