Skip to content

Instantly share code, notes, and snippets.

@cwjohnston
Created April 23, 2010 19:59
Show Gist options
  • Save cwjohnston/377094 to your computer and use it in GitHub Desktop.
Save cwjohnston/377094 to your computer and use it in GitHub Desktop.
hosts = {}
localhost = nil
search(:node, "*", %w(ipaddress fqdn dns_aliases)) do |n|
# node own's record, store in localhost
if n["ipaddress"] == node[:ipaddress]
localhost = n
else
hosts[n["ipaddress"]] = n
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment