how to get tag_name instead of private ip address?

when I run ansible-playbook task,
each instance results are shown with private ip.
(also I used aws dynamic inventory)

like this…

SSH password:

PLAY [all] ********************************************************************

TASK: [check tomcat status] ***************************************************
changed: [10.248.64.31]

PLAY RECAP ********************************************************************
10.248.64.31 : ok=1 changed=1 unreachable=0 failed=0

is there any solution that represent with aws tag_Name like below

SSH password:

PLAY [all] ********************************************************************

TASK: [check tomcat status] ***************************************************
changed: [webserver1]

PLAY RECAP ********************************************************************
webserver1 : ok=1 changed=1 unreachable=0 failed=0

  • aws 10.248.64.31 tag key is Name and value is webserver1

Try this, in ec2.ini:

  vpc_destination_variable = Name

(Or something other than Name if you want to use a different tag.)

                                      -Josh (jbs@care.com)

This email is intended for the person(s) to whom it is addressed and may contain information that is PRIVILEGED or CONFIDENTIAL. Any unauthorized use, distribution, copying, or disclosure by any person other than the addressee(s) is strictly prohibited. If you have received this email in error, please notify the sender immediately by return email and delete the message and any attachments from your system.

Good! thanks Josh

it works well :slight_smile:

2016년 1월 6일 수요일 오후 11시 48분 29초 UTC+9, Josh Smift 님의 말: