Signed-off-by: Stephen Gran <steve@lobefin.net>
module Puppet::Parser::Functions
newfunction(:allnodeinfo, :type => :rvalue) do |attributes|
- return function_ldapinfo('*', attributes)
+ require '/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb'
+ return (function_ldapinfo('*', attributes))
end
end
unless attributes.include?("*")
next if attributes.any?{ |a| not x[a] or x[a].empty? }
end
- results[x['hostname']] = x
+ results[host] = x
end
rescue LDAP::ResultError
raise Puppet::ParseError, "LDAP error"
ensure
ldap.unbind
end
- return( host == '*' ? results : results[host] )
+ if host == '*'
+ return(results)
+ else
+ return(results[host])
+ end
end
end
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
- results['ldap'] = function_ldapinfo(host, '*')
+ results['ldap'] = []
+ results['ldap'] << function_ldapinfo(host, '*')
+ return(results)
end
end