Skip to content

Instantly share code, notes, and snippets.

@mikesplain
Created July 28, 2014 16:30
Show Gist options
  • Save mikesplain/d4eb738c7b206ce3d96e to your computer and use it in GitHub Desktop.
Save mikesplain/d4eb738c7b206ce3d96e to your computer and use it in GitHub Desktop.
Find box ip's
## Figure out this box's ips
ips = []
node['network']['interfaces'].each do |int|
int[1]['addresses'].each do | ip, params |
if params['family'] == ('inet')
ips << ip
end
end
end
log "Found IPs: #{ips.to_s}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment