Sourcing ldap server configuration options from puppet.conf was conflating their original purpose, and a future release of Puppet may even remove these options.
It's still desirable to be able to set defaults for the function from a file, but a dedicated yaml file is far more flexible than an ini file.
In this commit, the old dispatch is renamed to legacy_query
and a new query
dispatch with a different signature replaces it.
The function is refactored to remove the instance variables.
The legacy_query
dispatch is simplified to just to the deprecated fetching of settings from puppet.conf and then call the new code.
Adding multi instance support by extending the options hash of the puppet parser function to give full parameter support for all needed internal net/ldap settings.
Adds also support for start_tls
ldap connections. Use $options = { tls => 'start_tls' }
in that case.
The ldap configuration via the [master]
section from puppet.conf
like defined in the README.md is still supported and the new parameter defaults to these options when not provided.
Example usage:
```
$filter = '(objectClass=posixAccount)'
$attributes = [
'dn',
'uid',
]
$options = {
server => 'ldap.example.com'
port => 636
tls => 'simple_tls'
cafile => '/etc/pki/tls/certs.pem'
base => 'dc=example,dc=com'
scope => 'sub'
user => 'cn=puppet,ou=people,dc=example,dc=com'
password => '',
}
$ldap_entries = ldapquery($filter, $attributes, $options)
```
None
modulesync 5.4.0