microsoft dynamic inventory

Trying to this to work any help would be great, I just can’t understand where the yaml file ( microsoft.ad.ldap.yaml file ) needs to be at and the python script that comes with the collection as well where does it go ?

What is supposed to be inside my inventory file ?

I have tried to run ansible-inventory -i microsoft.ad.ldap.yaml and I just errors that this is not a yaml file.

Thanks for any help

I just added an active directory and tested it from my ansible controller using ldapsearch and that works so now i know ldap can be reached from the controller to the active directory.

I just tried to run the yaml file according to what I understand ( i have a comprehension problem ) I get this output.

[ansible@ct01 ~]$ ansible-inventory -i inventories/microsoft.ad.ldap.yml --list
[WARNING]: * Failed to parse /home/ansible/inventories/microsoft.ad.ldap.yml with script plugin: problem running /home/ansible/inventories/microsoft.ad.ldap.yml --list ([Errno 8] Exec
format error: ‘/home/ansible/inventories/microsoft.ad.ldap.yml’)
[WARNING]: * Failed to parse /home/ansible/inventories/microsoft.ad.ldap.yml with auto plugin: Configuration file does not specify default realm -1765328160
[WARNING]: * Failed to parse /home/ansible/inventories/microsoft.ad.ldap.yml with yaml plugin: Plugin configuration YAML file, not YAML inventory
[WARNING]: * Failed to parse /home/ansible/inventories/microsoft.ad.ldap.yml with ini plugin: Invalid host pattern ‘plugin:’ supplied, ending in ‘:’ is not allowed, this character is
reserved to provide a port.
[WARNING]: * Failed to parse /home/ansible/inventories/microsoft.ad.ldap.yml with ansible_collections.microsoft.ad.plugins.inventory.ldap plugin: Configuration file does not specify
default realm -1765328160
[WARNING]: Unable to parse /home/ansible/inventories/microsoft.ad.ldap.yml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
{
“_meta”: {
“hostvars”: {}
},
“all”: {
“children”: [
“ungrouped”
]
}
}
[ansible@ct01 ~]$

Hi Andy,

This isn’t really the right group for general help using Ansible. This group is intended for questions related to developing Ansible or plugins. There’s a separate group ansible-project, which you also seem to have posted to, which is better suited to these kinds of questions. Additionally, there is also the forum: http://forum.ansible.com/

That said, while I’m not familiar with the AD plugin, it looks like the “auto” plugin has attempted to use your inventory file and successfully passed it onto the AD inventory plugin. The problem appears to be in the error/warning message: