blob: 7bc477f247eb4d49d9fa650098ae4ca75671fa84 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
# get an uniq array of ipaddresses for a hostname
require 'resolv'
module Puppet::Parser::Functions
newfunction(:hostname, :type => :rvalue) do |args|
res = Array.new
Resolv::DNS.new.each_address(args[0]){ |addr|
res << addr
}
res.uniq
end
end
|