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:
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:
----------
TASK [Ensure an LDAP entry exists for uid] *****************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: NO_SUCH_OBJECT: {'matched': u'dc=example,dc=com', 'desc': u'No such object'}
fatal: [192.168.XXX.XXX]: FAILED! => {"changed": false, "details": "{'matched': u'dc=example,dc=com', 'desc': u'No such object'}", "msg": "Entry action failed."}
Appreciate anyone's help here.
Regards,
Nikhil