# how to get tag\_name instead of private ip address?

**URL:** <https://forum.ansible.com/t/how-to-get-tag-name-instead-of-private-ip-address/20131>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [January 6, 2016, 6:11am UTC](https://forum.ansible.com/t/how-to-get-tag-name-instead-of-private-ip-address/20131 "2016-01-06T06:11:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaehyuk\_choi](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jaehyuk\_choi](https://forum.ansible.com/u/jaehyuk_choi)\
**Post date:** [January 6, 2016, 6:11am UTC](https://forum.ansible.com/t/how-to-get-tag-name-instead-of-private-ip-address/20131/1 "2016-01-06T06:11:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Josh\_Smift1](https://avatars.discourse-cdn.com/v4/letter/j/bcef8e/32.png) [@Josh\_Smift1](https://forum.ansible.com/u/Josh_Smift1)\
**Post date:** [January 6, 2016, 2:47pm UTC](https://forum.ansible.com/t/how-to-get-tag-name-instead-of-private-ip-address/20131/2 "2016-01-06T14:47:58Z")

</div>

Try this, in ec2.ini:

&nbsp;&nbsp;vpc\_destination\_variable = Name

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

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-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.

---

<div class="post-metadata">

**Author:** ![jaehyuk\_choi](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jaehyuk\_choi](https://forum.ansible.com/u/jaehyuk_choi)\
**Post date:** [January 11, 2016, 6:38am UTC](https://forum.ansible.com/t/how-to-get-tag-name-instead-of-private-ip-address/20131/3 "2016-01-11T06:38:06Z")

</div>

Good! thanks Josh

it works well 🙂

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