# ec2.py and ansible\_ssh\_host

**URL:** <https://forum.ansible.com/t/ec2-py-and-ansible-ssh-host/20072>\
**Category:** Ansible Project\
**Created:** [December 23, 2015, 9:13pm UTC](https://forum.ansible.com/t/ec2-py-and-ansible-ssh-host/20072 "2015-12-23T21:13:14Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [December 23, 2015, 9:13pm UTC](https://forum.ansible.com/t/ec2-py-and-ansible-ssh-host/20072/1 "2015-12-23T21:13:14Z")

</div>

We use the ec2.py inventory plugin, and

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

in ec2.ini so that our inventory shows the value of the Name tag rather  
than an IP address. However, we'd like to use the IP address from  
inventory to actually talk to the host, so that if the name doesn't show  
up in DNS right away after the instance is launched, we don't either fail  
or have to explicitly sit around waiting for it.

It looks like ec2.py doesn't set ansible\_ssh\_host or ansible\_host, unlike  
(e.g.) rax.py. Is that an intentional omission, or would something like  
that be a welcome addition?

&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:** ![alexey.vazhnov](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@alexey.vazhnov](https://forum.ansible.com/u/alexey.vazhnov)\
**Post date:** [December 24, 2015, 4:43am UTC](https://forum.ansible.com/t/ec2-py-and-ansible-ssh-host/20072/2 "2015-12-24T04:43:06Z")

</div>

You can use my version of ec2.py [https://github.com/vazhnov/fork\_ansible\_contrib\_inventory\_ec2.py](https://github.com/vazhnov/fork_ansible_contrib_inventory_ec2.py) before I pull this changes to mainstream.

---

<div class="post-metadata">

**Author:** ![alexey.vazhnov](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@alexey.vazhnov](https://forum.ansible.com/u/alexey.vazhnov)\
**Post date:** [December 25, 2015, 5:16am UTC](https://forum.ansible.com/t/ec2-py-and-ansible-ssh-host/20072/3 "2015-12-25T05:16:50Z")

</div>

I still waiting when my first pull request [https://github.com/ansible/ansible/pull/12190](https://github.com/ansible/ansible/pull/12190) will be approved, to send next changes.
