# Private Subnets & add\_host / wait\_for.

**URL:** <https://forum.ansible.com/t/private-subnets-add-host-wait-for/18074>\
**Category:** Ansible Project\
**Created:** [April 24, 2015, 11:01am UTC](https://forum.ansible.com/t/private-subnets-add-host-wait-for/18074 "2015-04-24T11:01:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nico\_K](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@Nico\_K](https://forum.ansible.com/u/Nico_K)\
**Post date:** [April 24, 2015, 11:01am UTC](https://forum.ansible.com/t/private-subnets-add-host-wait-for/18074/1 "2015-04-24T11:01:44Z")

</div>

Hi,

My EC2 instances are reachable via a jump host, however when I create a new EC2 instance as my first step of the play, the new DNS entry isn’t available yet so the jump host configuration is not being used yet.

I tried using ‘add\_host’ and also ‘wait\_for’ (to determine SSH availability) however, add\_host doesn’t really help me since the new DNS record doesn’t exist yet, and using the private\_dns\_name (…compute.internal) will not trigger the jump host, and even if it did (Adding a entry for ompute.internal) I would have no means of determining where to send it to next (Multiple clouds).

Ideally I am looking for a way to tell add\_host:

- The name of the machine I added (inventory\_hostname)
- The Jump host to use
- The private\_dns\_name (which is already known) to use once on the jump host.

Any ideas?

Thanks,  
Nico
