1 module Puppet::Parser::Functions
2 newfunction(:whohosts, :type => :rvalue) do |args|
8 parser.watch_file(yamlfile)
13 yaml = YAML.load_file(yamlfile)
15 if (nodeinfo['ldap'].at(0)) and (nodeinfo['ldap'][0].has_key?('ipHostNumber'))
16 nodeinfo['ldap'][0]['ipHostNumber'].each do |addr|
17 yaml.keys.each do |hoster|
18 yaml[hoster].each do |net|
19 if IPAddr.new(net).include?(addr)