cancel
Showing results for 
Search instead for 
Did you mean: 
rrathbun
Mission Specialist
Mission Specialist
  • 5,429 Views

Ansible AAP 2.4 Microsoft LDAP Plugin

Jump to solution

Does anyone here know how to manipulate the "name" field in the inventory when using the LDAP plugin with Ansible Automation Controller? I have the plugin working fine, thanks to Zack and this article Ansible Inventory: Microsoft AD Plugin (autodotes.com)

The import pulls the hostname into the name field, and I wanted the FQDN, but I am unsure how to manipulate it.

Labels (3)
1 Solution

Accepted Solutions
rrathbun
Mission Specialist
Mission Specialist
  • 3,921 Views

Ultimately this is how I ended up solving this:

I setup my microsoft.ad.ldap.yml file to look like below, and it returned the FQDN as desired.

plugin: microsoft.ad.ldap

attributes:

  inventory_hostname: ansible_host

View solution in original post

0 Kudos
14 Replies
Chetan_Tiwary_
Community Manager
Community Manager
  • 3,115 Views
0 Kudos
milang
Mission Specialist
Mission Specialist
  • 2,986 Views

you should be able to adjust the value returned by selecting `dnsHostName` instead of `Name`. 

# from the module documentation 
By default the inventory_hostname for a found host will be based on the name LDAP attribute value. If the dNSHostName attribute is set for the computer account found, it will be set as the ansible_host fact

Chetan_Tiwary_
Community Manager
Community Manager
  • 2,453 Views

@milang seems your last sentence was incomplete..

0 Kudos
milang
Mission Specialist
Mission Specialist
  • 2,405 Views

@Chetan_Tiwary_ yeah thanks .. copy&paste with a mobile doesn't seem to be working fine  

Chetan_Tiwary_
Community Manager
Community Manager
  • 2,361 Views

no problem at all @milang Thanks for your inputs !

0 Kudos
Psehgaf
Flight Engineer
Flight Engineer
  • 2,322 Views

You need to add:

Enter the user attributes in the LDAP User Attribute Map the text field. In this example, use:

{
"first_name": "givenName",
"last_name": "sn",
"email": "mail"
}
• ╚╬╦╬Psehgaft╬╦╬╝ ◦
Wasim_Raja
Moderator
Moderator
  • 2,311 Views

Awesome, thanks for sharing @Psehgaf 

0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 2,294 Views

Thanks @Psehgaf !

0 Kudos
Join the discussion
You must log in to join this conversation.