I'm using a bridged network on a vagrant VM with chef-client. knife node show test1-vagrant
shows an ip address of 10.0.2.15, which is eth0. eth1 is 192.168.1.5, which is what DHCP gave it. How can i get chef thinking the ip address is 192.168.1.5 instead, so that I can knife ssh -a ipaddress?
Asked
Active
Viewed 2,639 times
4

Ron Garrity
- 393
- 1
- 3
- 5
-
Consider running your VirtualBox VMs in bridged mode instead of NAT mode. – Michael Hampton Nov 07 '12 at 01:34
-
Even though you have private/public network configured Chef provisioner still uses 10.0.2.15 as node['ipaddress'] – Maxim Vladimirsky Apr 25 '13 at 08:05
-
maybe [this is the ticket](https://tickets.opscode.com/browse/OHAI-287) on the opscode site? – cwd Aug 13 '14 at 01:14
2 Answers
3
This cookbook might help you, it changes the ipaddress
node attribute to use the ip address associated to the eth1
interface: https://github.com/tknerr/cookbooks-vagrant-ohai

Thomas Dudziak
- 126
- 1
- 3
2
Here is a complete Vagrant Plugin that installs an ohai plugin that does something similar https://github.com/avishai-ish-shalom/vagrant-ohai
Only problem is right now it seems to only install it if you are using the :chef_solo or :chef_server provisioner.

Robert J Berger
- 121
- 3