dynamic inventory - hostname or ip address

265 views
Skip to first unread message

Bill WANG

unread,
Apr 29, 2016, 12:47:24 AM4/29/16
to Ansible Project
Hi all,

I got dynamic inventory for ec2 instances via ansible. But the host in export are all IP addresses. 


In ec2.ini

vpc_destination_variable = private_ip_address


Sample of dynamic inventory output:

  "tag_Name_abc01_example_com": [
   
"10_1_1_15"
 
],



So when run playbook, I have limit with it IP address, such as 10_1_1_15

What can I do do to use its tag Name as host in inventory?

Bill WANG

unread,
Apr 29, 2016, 2:27:01 AM4/29/16
to Ansible Project
In ansible cache, the index is built and archive with private ip address.

  "10_1_1_15": [
    "us-east-2",
    "i-6652342vs"
  ],

Alexey Vazhnov

unread,
May 4, 2016, 8:34:36 AM5/4/16
to Ansible Project
You can use in ec2.ini:
tag_destination_variable = Name
Reply all
Reply to author
Forward
0 new messages