15 lines
429 B
Ruby
15 lines
429 B
Ruby
|
# dnsLookup.rb
|
||
|
# does a DNS lookup and returns an array of strings of the results
|
||
|
# from http://geek.jasonhancock.com/2011/04/20/doing-a-dns-lookup-inside-your-puppet-manifest/
|
||
|
|
||
|
require 'resolv'
|
||
|
|
||
|
module Eid::Functions
|
||
|
newfunction(:dnsLookup, :type => :rvalue) do |args|
|
||
|
result = []
|
||
|
result = Resolv.new.getaddresses(args[0])
|
||
|
debug("resolving #{args[0]} to #{result}")
|
||
|
return result
|
||
|
end
|
||
|
end
|