Created
July 28, 2014 16:30
-
-
Save mikesplain/d4eb738c7b206ce3d96e to your computer and use it in GitHub Desktop.
Find box ip's
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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