Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@datacoda
Created February 23, 2014 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save datacoda/9176714 to your computer and use it in GitHub Desktop.
Save datacoda/9176714 to your computer and use it in GitHub Desktop.
Getting public addresses from chef node attributes.
node['network']['interfaces'].map { |i,iface| iface['addresses'].select { |j,addr| addr['scope']=='Global' }.keys }.flatten
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment