1 module Puppet::Parser::Functions
2 newfunction(:nodeinfo, :type => :rvalue) do |args|
6 parser.watch_file(yamlfile)
13 yaml = YAML.load_file(yamlfile)
16 ['nameinfo', 'footer'].each do |detail|
17 if yaml.has_key?(detail)
18 if yaml[detail].has_key?(host)
19 results[detail] = yaml[detail][host]
24 ldap = LDAP::Conn.new('samosa.debian.org')
27 filter = '(hostname=' + host +')'
29 ldap.search2('ou=hosts,dc=debian,dc=org', LDAP::LDAP_SCOPE_SUBTREE, filter) do |x|
32 rescue LDAP::ResultError