Allow ldapserver to be passed as argument

Put options for ldapquery into opts argument
This commit is contained in:
Trey Dockendorf
2020-06-24 08:51:36 -04:00
parent f9c350da5b
commit 8d30438431
2 changed files with 11 additions and 8 deletions

View File

@@ -9,11 +9,13 @@ module PuppetX
filter,
attributes = [],
base = Puppet[:ldapbase],
scope = 'sub'
scope = 'sub',
server = Puppet[:ldapserver]
)
@filter = filter
@attributes = attributes
@base = base
@host = server
return unless scope
@@ -41,7 +43,6 @@ module PuppetX
end
end
host = Puppet[:ldapserver]
port = Puppet[:ldapport]
if Puppet[:ldapuser] && Puppet[:ldappassword]
@@ -53,7 +54,7 @@ module PuppetX
ca_file = "#{Puppet[:confdir]}/ldap_ca.pem"
conf = {
host: host,
host: @host,
port: port
}