Skip to content

Instantly share code, notes, and snippets.

@agoddard
Created February 1, 2012 00:18
Show Gist options
  • Save agoddard/1714141 to your computer and use it in GitHub Desktop.
Save agoddard/1714141 to your computer and use it in GitHub Desktop.
populating DNS A records
hosts = search(:node, "*:*")
domains = {}
hosts.each do |node|
unless node.domain.nil?
domains[node.domain.to_sym] = [] if domains[node.domain.to_sym].nil?
domains[node.domain.to_sym] << {node.fqdn => node.ipaddress}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment