mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-06 06:04:24 -07:00
Added ldap_search module for searching in LDAP servers (#126)
* fix CI * Added ldap_search module for searching in LDAP servers * Fixes from pipeline * Fixed second script as well * fix DOCUMENTATION block * fix DOCUMENTATION block * fix DOCUMENTATION block * fix examples and remove changelog fragment * Added integration tests for ldap_search * fixes Co-authored-by: Sebastian Pfahl <sebastian.pfahl@dcso.de>
This commit is contained in:
parent
2639d4c023
commit
e3e6c6167e
13 changed files with 425 additions and 0 deletions
6
tests/integration/targets/ldap_search/tasks/main.yml
Normal file
6
tests/integration/targets/ldap_search/tasks/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
- name: Run LDAP search module tests
|
||||
block:
|
||||
- include_tasks: "{{ item }}"
|
||||
with_fileglob:
|
||||
- 'tests/*.yml'
|
||||
when: ansible_os_family in ['Ubuntu', 'Debian']
|
0
tests/integration/targets/ldap_search/tasks/run-test.yml
Normal file
0
tests/integration/targets/ldap_search/tasks/run-test.yml
Normal file
20
tests/integration/targets/ldap_search/tasks/tests/basic.yml
Normal file
20
tests/integration/targets/ldap_search/tasks/tests/basic.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
- debug:
|
||||
msg: Running tests/basic.yml
|
||||
|
||||
####################################################################
|
||||
## Search ##########################################################
|
||||
####################################################################
|
||||
- name: Test simple search for a user
|
||||
ldap_search:
|
||||
dn: "ou=users,dc=example,dc=com"
|
||||
scope: "onelevel"
|
||||
filter: "(uid=ldaptest)"
|
||||
ignore_errors: yes
|
||||
register: output
|
||||
|
||||
- name: assert that test LDAP user can be found
|
||||
assert:
|
||||
that:
|
||||
- output is not failed
|
||||
- output.results | length == 1
|
||||
- output.results.0.displayName == "LDAP Test"
|
Loading…
Add table
Add a link
Reference in a new issue