I am running into a similar situation and have been thinking about using 
the shell: ping approach too. But what I came up in the following didn't 
seem to do the trick. Would appreciate a hint:

---
- name: ping a remote host many times
  local_action: shell ping -v {{ inventory_hostname }}
  register: result
  until: result.stdout.rc == '0'
  retries: 5
  delay: 5

I can also confirm that the typical approach using wait_for as published, 
e.g. by ansible support 
<https://support.ansible.com/hc/en-us/articles/201958037-Reboot-a-server-and-wait-for-it-to-come-back>,
 
works only with one-hop, anytime ssh jump-host (more than one hop) is used, 
the approach fails.

--Zack
On Friday, January 17, 2014 1:47:43 PM UTC-8, Michael DeHaan wrote:
>
> Yeah, I'm open to the idea of a ping module action_plugin that takes a 
> 'mode=icmp' (default ssh).
>
> You could also just do a "shell: ping" (making sure to ping just once) and 
> register the return code.
>
>
>
>
> On Fri, Jan 17, 2014 at 3:59 PM, Anand Buddhdev <[email protected] 
> <javascript:>> wrote:
>
>> On Friday, 17 January 2014 21:38:41 UTC+1, Michael DeHaan wrote:
>>
>> You could consider running Ansible from the bastion host, versus using an 
>>> SSH jumphost which I infer you are using above.
>>>
>>
>> Yes, by bastion, I meant an SSH jump host.
>>  
>>
>>>  The ping module doesn't ICMP ping, BTW, it's a basic Ansible 
>>> connectivity test.
>>>
>>
>> Yes, I realise that the ansible ping module is not ICMP, but an SSH 
>> connection. The SSH jump host doesn't have ansible installed, and I don't 
>> have root access on it. I can of course install ansible in a virtualenv, 
>> but I was hoping for some cleverer way of detecting host down/up from 
>> within a playbook run from my laptop. I suppose my use-case is an outlier, 
>> so I'll try to see what I can do on the jump host. 
>>  -- 
>> 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:>.
>> To post to this group, send 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].
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/7a7f5271-ecf2-42eb-83cf-301dc1cc73be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to