Skip to content

Instantly share code, notes, and snippets.

@martinisoft
Created January 28, 2014 18:25
Show Gist options
  • Save martinisoft/8673261 to your computer and use it in GitHub Desktop.
Save martinisoft/8673261 to your computer and use it in GitHub Desktop.
Crazy ohai plugin to re-write network address
provide "ipaddress"
require_plugin "#{os}::network"
require_plugin "#{os}::virtualization"
if virtualization["system"] == "openvz"
network["interfaces"]["venet0:0"]["addresses"].each do |ip, params|
if params["family"] == "inet"
ipaddress ip
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment