Skip to content

Instantly share code, notes, and snippets.

@turtlebender
Created March 16, 2012 14:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save turtlebender/2050259 to your computer and use it in GitHub Desktop.
Save turtlebender/2050259 to your computer and use it in GitHub Desktop.
ohai plugin for setting the ipaddress to the eth1. This is particularly useful for running multi-vm vagrant with chef trying to connect the various boxes
provide "ipaddress"
require_plugin "#{os}::network"
network["interfaces"]["eth1"]["addresses"].each do |ip, params|
if params['family'] == ('inet')
ipaddress ip
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment