Closed Akasurde closed 7 months ago
cc @andysmagana
Can you share the actual microsoft.ad.ldap.yaml
file please @andysmagana. Looking briefly at https://github.com/ansible/ansible/issues/82633#issuecomment-1921048349 the error seems to be
[WARNING]: * Failed to parse /home/ansible/inventories/microsoft.ad.ldap.yml with ansible_collections.microsoft.ad.plugins.inventory.ldap plugin: Cannot lookup server without the
python libraries krb5
File "/usr/lib/python3.9/site-packages/ansible/inventory/manager.py", line 293, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/home/ansible/collections/ansible_collections/microsoft/ad/plugins/inventory/ldap.py", line 310, in parse
with create_ldap_connection(**connection_options) as client:
File "/home/ansible/collections/ansible_collections/microsoft/ad/plugins/plugin_utils/_ldap/__init__.py", line 86, in create_ldap_connection
server, lookup_port = lookup_ldap_server()
File "/home/ansible/collections/ansible_collections/microsoft/ad/plugins/plugin_utils/_ldap/_lookup.py", line 88, in lookup_ldap_server
raise ImportError(f"Cannot lookup server without the python libraries {', '.join(missing_libs)}")
It seems like you haven't specified a domain controller to lookup, the implicit domain controller only works if you have certain Python libraries installed and Kerberos has been configured with a default realm. In this case the error is saying you don't have the krb5 Python library. You can see more by running the microsoft.ad.debug_ldap_client
- hosts: localhost
gather_facts: false
tasks:
- microsoft.ad.debug_ldap_client:
The packages
return value tells you what Python libraries are present and what ones are misssing. If the krb5
Python library is installed it also tells you what the default realm would be as well as some other information that might be useful.
Closing due to no response.
Summary
ansible-inventory -i inventories/microsoft.ad.ldap.yml --list -vvv
Gets error about not able to parse yaml file.
Issue Type
Bug Report
Component Name
microsoft.ad.ldap dynamic inventory
Ansible Version
Configuration
OS / Environment
Red Hat Enterprise Linux release 9.3 (Plow)
Steps to Reproduce
ansible-inventory -i inventories/microsoft.ad.ldap.yml --list -vvv
Expected Results
Should not do that I expect to list target hosts.
Actual Results
Code of Conduct