Reduce the number of interfaces duplicates
When the mac address of an interface changes, it gets duplicate. Example with a bonding interface which has mac address ff:ff:ff:ff:ff:ff when down. We should handle that in a better way and avoid as much duplicates as possible.
#4 Updated by Marek Hulán about 7 years ago
This was on purpose because we can't really say whether interface got different mac or there's new one with the same mac. Note that vlans, aliases and bonds has the same mac of physical interface they're attached to. Seems like bonds would need special treatment, other virtual interfaces that are down were not part of facts upload. Could you please upload example of facter output with bond that's down? I think the PR does not solve the issue properly. I'm afraid we don't even import bond interfaces as bonds but generic managed interface.
#5 Updated by Julien Pivotto about 7 years ago
Bond interfaces are imported as bond -- they are recognized by their name in the FactParser. When the bond is down the facter output is the same -- just that the bond mac address is blank.
"This was on purpose because we can't really say whether interface got different mac or there's new one with the same mac. "
My proposal is just to pick the interface with the same mac address and name, if not the interface with the mac address if the mac address is not blank, and then only pick the name.
In Linux the unique identifier for an interface is the name. The mac address can be shared, like you said.