Ansible returns an error: Error: -1 - Can't contact LDAP server - 2 - [] - No such file or directory
failed: [some_host] (item=~/some_ldif) => {"ansible_loop_var": "item", "changed": true, "cmd": ["/usr/sbin/dsconf", "-D", "cn=admin", "
-w", "some_pass", "ldap://some_fqdn", "backend", "import", "userRoot", "/var/lib/dirsrv/slapd-host/ldif/some_ldif"], "delta":
"0:00:00.487725", "end": "some_time", "item": "~/some_ldif", "msg": "non-zero return code", "rc": 1, "start": "some_time", "stderr": "",
"stderr_lines": [], "stdout": "Error: -1 - Can't contact LDAP server - 2 - [] - No such file or directory", "stdout_lines": ["Error: -1 - Can't
contact LDAP server - 2 - [] - No such file or directory"]}
Most likely, the problem is that at the place where the task is running, the instance is not yet running. Of the possible solutions, you can place this task after the start of the service.
I don't know why that other command wasn't used (I didn't code that part of the role), so for me it's ok to make the change. I'd really appreciate a PR indeed.
Thanks
Ansible returns an error: Error: -1 - Can't contact LDAP server - 2 - [] - No such file or directory
Most likely, the problem is that at the place where the task is running, the instance is not yet running. Of the possible solutions, you can place this task after the start of the service.
Or execute a command like:
Instead of: (how it is done now)
This does not require ldap:// connection and imports the changes directly into the instance and does not require service start. Why isn't this used?
P.S. I can create a PR with one of these variants