yamlfile = args[1]
parser.watch_file(yamlfile)
- require 'ldap'
require 'yaml'
+ require '/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb'
$KCODE = 'utf-8'
end
end
- ldap = LDAP::SSLConn.new('db.debian.org', 636)
-
- results['ldap'] = []
- filter = '(hostname=' + host +')'
- begin
- ldap.search2('ou=hosts,dc=debian,dc=org', LDAP::LDAP_SCOPE_SUBTREE, filter) do |x|
- results['ldap'] << x
- end
- rescue LDAP::ResultError
- raise Puppet::ParseError, "LDAP error"
- rescue RuntimeError
- raise Puppet::ParseError, "No data returned from search"
- ensure
- ldap.unbind
- end
+ results['ldap'] = function_ldapinfo(host, '*')
return(results)
end
end