# LDAP integration with ldap\_entry module.

**URL:** <https://forum.ansible.com/t/ldap-integration-with-ldap-entry-module/30044>\
**Category:** Ansible Project\
**Created:** [April 3, 2019, 8:16am UTC](https://forum.ansible.com/t/ldap-integration-with-ldap-entry-module/30044 "2019-04-03T08:16:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikhil1](https://avatars.discourse-cdn.com/v4/letter/n/c89c15/32.png) [@Nikhil1](https://forum.ansible.com/u/Nikhil1)\
**Post date:** [April 3, 2019, 8:16am UTC](https://forum.ansible.com/t/ldap-integration-with-ldap-entry-module/30044/1 "2019-04-03T08:16:12Z")

</div>

Hi,

Am trying to interface with LDAP on Linux and creating a new user. if uid doesn’t exist, then it should ideally create one. However, am getting below error.

My ansible playbbok is as below:

- name: LDAP user check  
hosts: LOCAL  
tasks:

- name: check ldap entry  
ldap\_entry:  
dn: cn=admin,dc=example,dc=com  
objectClass:

- simpleSecurityObject

- organizationalRole

- name: Ensure an LDAP entry exists for uid  
ldap\_entry:  
server\_uri: ldaps://directory.example.com:636  
bind\_dn: cn=admin,dc=example,dc=com  
bind\_pw: XXXXXX  
dn: uid=njain10,ou=people,dc=example,dc=com  
objectClass:

- account  
attributes:  
uid: njain10

ERROR:

---

<div class="post-metadata">

**Author:** ![Javi\_Legido](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@Javi\_Legido](https://forum.ansible.com/u/Javi_Legido)\
**Post date:** [April 21, 2020, 5:17am UTC](https://forum.ansible.com/t/ldap-integration-with-ldap-entry-module/30044/2 "2020-04-21T05:17:52Z")

</div>

Hi there.

I strongly suggest first try to create the user by hand, to discard errors such as wrong domain and so on.

Cheers.
