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

Use ohai to determine network IP, allow specification primary network interface for hostsfile generation. #26

Merged

Conversation

jhohertz
Copy link
Contributor

  • adds a primary_interface config value, defaulting to what Ohai found to be the default_interface.
  • hostfile entry for the local node switched to use ohai network info, using the primary_interface as a key. The first IP address found on the interface is used, matching prior behaviour.
  • Useful for test kitchens, allowing the vagrant NAT interface to be side-stepped for the purposes of generating /etc/hosts (IE: trying to simulate clusters, which were getting bad reverse lookup info via the existing behaviour for generation of /etc/hosts

Thought this would be useful to others, and I'm happy to adjust the code to get it upstream.

Thanks for having a look.

…ce to look at via primary_interface config value, defaulting to what Ohai found to be the default_interface. Useful for test kitchens, allowing the vagrant NAT interface to be side-stepped for the purposes of generating /etc/hosts
@flaccid
Copy link
Contributor

flaccid commented Aug 12, 2015

Thanks very much for this. Could we just get the tests to pass and see if we can write a few tests for this functionality?

@jhohertz
Copy link
Contributor Author

Having a look into that now.

@jhohertz
Copy link
Contributor Author

Re: testing the functionality, I'll need to add a private interface to the kitchen suite.

Any suggestions on what IP/network would be best to use?

@flaccid
Copy link
Contributor

flaccid commented Aug 13, 2015

@jhohertz there are known range conflicts that is true. I ended using https://github.com/flaccid/rancher-test-farm/blob/master/Vagrantfile#L13-L14 - anything in that /16 should be ok iirc.

@flaccid
Copy link
Contributor

flaccid commented Aug 19, 2015

@jhohertz any luck? I've been starved for time lately, don't mind waiting for those tests before we release next.

@jhohertz
Copy link
Contributor Author

Yeah I know the feeling.... I fixed the style warnings but need to add a test still, i'll try to look at that today.

…not exist prior. The kitchen has been modified to specify a second interface, and to specify said interface as the primary. The test looks for the IP of the secondary interface in this entry.
@jhohertz
Copy link
Contributor Author

So at this point I have added a test which ensure coverage of the new feature, but not sure how I can test not using it without launching a second suite without the feature enabled. If you'd like me to go that route, I'll happily set it up, but it feels a bit extreme for one test.

Let me know, otherwise I think it's good to go. Happy to hear other suggestions on approach.

@flaccid
Copy link
Contributor

flaccid commented Aug 23, 2015

I'll ponder on that notion, its always a hard one to test different integration setups. Thanks very much for this!

flaccid added a commit that referenced this pull request Aug 23, 2015
Use ohai to determine network IP, allow specification primary network interface for hostsfile generation.
@flaccid flaccid merged commit e852755 into xhost-cookbooks:master Aug 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants