How to have Chef use a different ip

chefvagrant

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?

Best Answer

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