Michael,

Thank you. Looks like you already anticipated the need for this. Sorry I 
missed it. 

It worked. For the sake of others, here is the statement that accomplished 
the task. It wouldn't work without the "local_action" part.  I put this in 
my "main.yml" under the "vm" role.

[VM creation tasks...]

  - name: Wait for the Kickstart install to complete and the VM to reboot
    local_action: wait_for host={{ vm_hostname }} port=22 delay=30 
timeout=1200 state=started

  - name: Now configure the VM...

--Aaron
DevOps Blog: http://www.sharknet.us

On Wednesday, December 11, 2013 10:05:02 AM UTC-5, Michael DeHaan wrote:
>
> This is a great place to use the "wait_for" module to wait for the port to 
> become open.
>
>
>
>
> On Wed, Dec 11, 2013 at 9:31 AM, Aaron Hunter 
> <[email protected]<javascript:>
> > wrote:
>
>> I have a complex playbook that will provision a CentOS VM on a XenServer 
>> pool from scratch and then configure the VM according to its roles. It 
>> works very well (and I'm very impressed with Ansible) except for one part. 
>> As XenServer installs the VM and OS (via a delegate_to call in the Task)  
>> it takes time and the VM is not yet online. The next step in my Ansible 
>> script tries to connect to the new and still offline VM and promptly fails. 
>> Neither 'async' nor 'do-until' have worked. It always fails because Ansible 
>> cannot connect via SSH to the newly spun up VM.
>>
>> My question is, how can I get this task to keep trying to connect? I 
>> could not find anything in the docs or Google to suggest an approach.
>>
>> Thank you,
>> Aaron
>>
>> DevOps Blog: http://www.sharknet.us 
>>  
>> -- 
>> 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] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Michael DeHaan <[email protected] <javascript:>>
> CTO, AnsibleWorks, Inc.
> http://www.ansibleworks.com/
>
>  

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to