Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
better handling of Linux ip addresses #29209
This has multiple fixes, it puts primary ip addreses in a list under ansible_ifname:ipv4, prevents double entries of secondary ip addresses under ansible_ifname:ipv4_secondaries, also (mostly by accident) makes the fact format consistent with generic_bsd facts, where ansible_ifname:ipv4 is a list, unlike current linux where it's a dictionary.
The logic behind the module is wrong. At line 190 it checks whether the ip is secondary and if no ipv4 is present, so that can activate only once. After that at line 195 it doesn't check whether the ip is secondary.
With interface configured as follows:
The result is:
Since this would break those that use current Linux output, we shoul probably look into alternative solution.
One posibility is leaving
Other posibility is just to have first address as
Deduplication part should not break anything.