Created
February 1, 2012 00:18
-
-
Save agoddard/1714141 to your computer and use it in GitHub Desktop.
populating DNS A records
This file contains 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
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