Perhaps it's taking longer because an EIP is involved, apologies as my
previous info-sharing was based on general SSH experiments.

Could it be that the EIP itself is not yet ready?




On Fri, Jun 27, 2014 at 11:29 AM, Slim Slam <[email protected]> wrote:

> It's still not working. I even made the pause 10 seconds (see below). SSH
> still doesn't work
> until maybe 30 seconds later. I'm launching an m3large instance and I'm
> only
> using the Amazon Linux base (no customization).  AMI: ami-7c807d14
>
> Any ideas?
>
> J
>
>
>
>
>     - name: Tie elastic IP to the instance
>       ec2_eip: instance_id={{ item }} region={{ region }} public_ip={{
> my_elastic_ip }}
>       with_items: ec2_info.instance_ids
>
>     - name: wait for instances to listen on port:22
>
>       wait_for: timeout=480 state=started host={{ my_elastic_ip }} port=22
>
>     - pause: seconds=10
>
>
>
>
> On Thursday, June 26, 2014 3:22:57 PM UTC-5, Slim Slam wrote:
>>
>> Does anyone have an example of waiting for an Elastic IP address to
>> become "ready" to access? Apparently, waiting for state=started and
>> port 22 to become accessible (see below) is not sufficient.  The
>> next step after this usually fails because the Elastic IP isn't ready yet.
>>
>> J
>>
>> =================================
>>
>> - name: Start a test instance
>>   hosts: 127.0.0.1
>>   connection: local
>>   gather_facts: no
>>   vars:
>>     my_elastic_ip: aa.bb.cc.dd
>>     key: somekey
>>     instance_name: MYFUNTEST
>>     image: ami-0000000
>>     instance_type: m3.large
>>     region: us-east-1
>>     security_group: test
>>   tasks:
>>     - name: Start an instance
>>       local_action:
>>         module: ec2
>>         instance_tags:
>>            Name: '{{ instance_name }}'
>>         key_name: '{{ key }}'
>>         image: '{{ image }}'
>>         region: '{{ region }}'
>>         group: '{{ security_group }}'
>>         instance_type: '{{ instance_type }}'
>>         wait: True
>>       register: ec2_info
>>
>>
>>     - add_host: hostname={{ item.public_ip }} groupname=ec2hosts
>>       with_items: ec2_info.instances
>>
>>
>>     - name: Tie elastic IP to the instance
>>       ec2_eip: instance_id={{ item }} region={{ region }} public_ip={{
>> my_elastic_ip }}
>>       with_items: ec2_info.instance_ids
>>
>>
>>     - name: wait for instances to listen on port:22
>>       wait_for:
>>         timeout=480
>>         state=started
>>         host={{ item.public_ip }}
>>         port=22
>>       with_items: ec2_info.instances
>>
>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/6bea415c-6cc8-4c6f-8b31-26a1daacf40e%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/6bea415c-6cc8-4c6f-8b31-26a1daacf40e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgx1GsbKvP-0jbtwjijFCDKpxRPcj%3DTUDhHJHg%2B4tmhDeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to