cancel
Showing results for 
Search instead for 
Did you mean: 
rrathbun
Mission Specialist
Mission Specialist
  • 4,583 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,075 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
  • 2,683 Views
0 Kudos
milang
Mission Specialist
Mission Specialist
  • 2,554 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,021 Views

@milang seems your last sentence was incomplete..

0 Kudos
milang
Mission Specialist
Mission Specialist
  • 1,973 Views

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

Chetan_Tiwary_
Community Manager
Community Manager
  • 1,929 Views

no problem at all @milang Thanks for your inputs !

0 Kudos
Psehgaf
Flight Engineer
Flight Engineer
  • 1,890 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
  • 1,879 Views

Awesome, thanks for sharing @Psehgaf 

0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 1,862 Views

Thanks @Psehgaf !

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