Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ldap_entry: Error libldap2 #9030

Open
1 task done
nodje opened this issue Oct 16, 2024 · 4 comments
Open
1 task done

ldap_entry: Error libldap2 #9030

nodje opened this issue Oct 16, 2024 · 4 comments
Labels
bug This issue/PR relates to a bug integration tests/integration module module tests tests traceback

Comments

@nodje
Copy link

nodje commented Oct 16, 2024

Summary

this is probably heavily environment related, so I´ll as precise as possible on this level.

The error shows up when using community.general.ldap_entry :
ImportError: libldap_r-2.4.so.2: cannot open shared object file: No such file or directory

Issue Type

Bug Report

Component Name

ldap_entry

Other information that's not the component name

ubuntu 20.04.6 LTS
gcc-11 installed from ppa:ubuntu-toolchain-r/test
additional packages: build-essential libsasl2-dev libldap2-dev libssl-dev
Python 3.12.6 venv

python requirements.txt:
ansible-core==2.17.5
ansible-lint
python-ldap==3.4.4

Ansible Version

$ ansible --version
ansible [core 2.17.5]
  config file = /home/shared/projects/ldap-keycloak-poc/ansible.cfg
  configured module search path = ['/home/jseurin01/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/shared/projects/ldap-keycloak-poc/.venv/lib/python3.12/site-packages/ansible
  ansible collection location = /home/jseurin01/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/shared/projects/ldap-keycloak-poc/.venv/bin/ansible
  python version = 3.12.6 (main, Sep  6 2024, 19:03:47) [GCC 11.4.0] (/home/shared/projects/ldap-keycloak-poc/.venv/bin/python3.12)
  jinja version = 3.1.4
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general
Collection        Version
----------------- -------
community.general 9.5.0

Configuration

$ ansible-config dump --only-changed
CONFIG_FILE() = /home/shared/projects/ldap-keycloak-poc/ansible.cfg
PAGER(env: PAGER) = less

OS / Environment

libldap2-dev | 2.4.49+dfsg-2ubuntu1 is the version installed

This is the location of the libldap on the machine:

lrwxrwxrwx 1 root root     18 Jan 25  2024 /usr/lib/x86_64-linux-gnu/libldap-2.4.so.2 -> libldap_r-2.4.so.2
lrwxrwxrwx 1 root root     11 Jan 25  2024 /usr/lib/x86_64-linux-gnu/libldap.a -> libldap_r.a
lrwxrwxrwx 1 root root     24 Jan 25  2024 /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 -> libldap_r-2.4.so.2.10.12
-rw-r--r-- 1 root root 339472 Jan 25  2024 /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2.10.12
-rw-r--r-- 1 root root 683156 Jan 25  2024 /usr/lib/x86_64-linux-gnu/libldap_r.a
lrwxrwxrwx 1 root root     24 Jan 25  2024 /usr/lib/x86_64-linux-gnu/libldap_r.so -> libldap_r-2.4.so.2.10.12
lrwxrwxrwx 1 root root     12 Jan 25  2024 /usr/lib/x86_64-linux-gnu/libldap.so -> libldap_r.so

Steps to Reproduce

  - name: Make sure we have a parent entry for users
       community.general.ldap_entry:
       **

Expected Results

it should run the task

Actual Results

The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_community.general.ldap_entry_payload_wv8ttlex/ansible_community.general.ldap_entry_payload.zip/ansible_collections/community/general/plugins/modules/ldap_entry.py", line 158, in <module>
    import ldap.modlist
  File "/home/shared/projects/ldap-keycloak-poc/.venv/lib/python3.12/site-packages/ldap/__init__.py", line 34, in <module>
    import _ldap
ImportError: libldap_r-2.4.so.2: cannot open shared object file: No such file or directory
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "attributes": {},
            "bind_dn": "cn=admin,dc=example,dc=com",
            "bind_pw": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "ca_path": null,
            "client_cert": null,
            "client_key": null,
            "dn": "ou=users,dc=example,dc=com",
            "objectClass": [
                "organizationalUnit"
            ],
            "recursive": false,
            "referrals_chasing": "anonymous",
            "sasl_class": "external",
            "server_uri": "ldap://openldap-upstream:31389",
            "start_tls": false,
            "state": "present",
            "validate_certs": true,
            "xorder_discovery": "auto"
        }
    },
    "msg": "Failed to import the required Python library (python-ldap) on M093-2156858's Python /home/shared/projects/ldap-keycloak-poc/.venv/bin/python3.12. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"
}

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added bug This issue/PR relates to a bug integration tests/integration tests tests traceback labels Oct 16, 2024
@ansibullbot

This comment was marked as outdated.

@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

cc @jtyr
click here for bot help

@ansibullbot ansibullbot added the module module label Oct 16, 2024
@russoz russoz changed the title Error libldap2 using community.general.ldap_entry ldap_entry: Error libldap2 Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug integration tests/integration module module tests tests traceback
Projects
None yet
Development

No branches or pull requests

2 participants