Skip to content

Instantly share code, notes, and snippets.

@1000k
Created April 21, 2014 06:20
Show Gist options
  • Save 1000k/11133853 to your computer and use it in GitHub Desktop.
Save 1000k/11133853 to your computer and use it in GitHub Desktop.
Ohai plugin to correct ipaddress specified in Vagrantfile.
# see: https://gist.github.com/turtlebender/2050259
# see: http://stackoverflow.com/questions/14518236/vagrant-how-to-get-hostonly-ip-adress-from-within-chef-recipe
provide "ipaddress"
require_plugin "#{os}::network"
ipaddress network['interfaces']['eth1']['addresses'].detect{|k,v| v['family'] == "inet" }.first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment