Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort ip addresses chooses the wrong primary IPv4 #20

Closed
JOJ0 opened this issue Sep 1, 2021 · 4 comments
Closed

Sort ip addresses chooses the wrong primary IPv4 #20

JOJ0 opened this issue Sep 1, 2021 · 4 comments
Assignees
Labels

Comments

@JOJ0
Copy link

JOJ0 commented Sep 1, 2021

Hi,
since this commit we are experiencing an issue on our servers: 86ff7be

Usually we have the hosts "physical" interface on e.g eth0 and then several interfaces for running services e.g eth0:123, eth0:124

Let's assume host ip is 192.168.0.200 and service ips are 192.168.0.123 and 192.168.0.124

Prior to mentioned commit the behaviour was as expected: If hosts::one_primary_ipv4: true, the ip address
192.168.0.200 would be under # Primary interface

Now the new behaviour is that the sorting puts the lowest IP address first (192.168.0.123) and uses it as the Primary interface.
We can't assume that always the lowest IP is also the node IP. We would expect the physical interface (i.e eth0 vs. eth0:something) to be used as the first primary_ipv4 interface.

@JOJ0
Copy link
Author

JOJ0 commented Sep 1, 2021

In the meantime we downgraded to 3.0.1, to fix the issue on our servers :-)

@chrekh
Copy link
Owner

chrekh commented Sep 1, 2021

Thanks for the report. This was indeed unfortunate and bad: I'll look into it later, and if I don't come up with a better solution make the sorting optional by boolean parameter, (defaulting to false)

@chrekh chrekh added the bug label Sep 1, 2021
@JOJ0
Copy link
Author

JOJ0 commented Sep 1, 2021

Thanks for your quick reply! That's great news! Since downgrading fixes it for us without any tedious workarounds, there is no need to hurry, at least on our side! Good luck with finding a good solution. Fun fact: We also thought about that making the sorting configurable could be a possible solution!

@chrekh chrekh self-assigned this Sep 5, 2021
chrekh added a commit that referenced this issue Sep 5, 2021
Fix for issue #20, sorting addresses before selecting the first one is causing
the wrong IP to be selected. Fix this by moving the sorting from the fact ruby
code to init.pp and only sort when one_primary_ipx is in effect.
chrekh added a commit that referenced this issue Sep 8, 2021
Fix for issue #20, sorting addresses before selecting the first one is causing
the wrong IP to be selected. Fix this by moving the sorting from the fact ruby
code to init.pp and only sort when one_primary_ipx is in effect.
@chrekh
Copy link
Owner

chrekh commented Oct 23, 2021

This should be fixed in version 4.0.0

@chrekh chrekh closed this as completed Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants