mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -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/aliases
Normal file
6
tests/integration/targets/ldap_search/aliases
Normal file
|
@ -0,0 +1,6 @@
|
|||
shippable/posix/group1
|
||||
skip/aix
|
||||
skip/freebsd
|
||||
skip/osx
|
||||
skip/rhel
|
||||
needs/root
|
3
tests/integration/targets/ldap_search/meta/main.yml
Normal file
3
tests/integration/targets/ldap_search/meta/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- setup_openldap
|
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