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:
eryx12o45 2020-04-17 10:53:37 +02:00 committed by GitHub
commit e3e6c6167e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 425 additions and 0 deletions

View file

@ -0,0 +1,6 @@
shippable/posix/group1
skip/aix
skip/freebsd
skip/osx
skip/rhel
needs/root

View file

@ -0,0 +1,3 @@
---
dependencies:
- setup_openldap

View 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']

View 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"