Quick correction and follow-up:
I should have been more careful when cut-n-paste.
The task include file should be
---
- name: ping a remote host many times
local_action: shell ping -v {{ inventory_hostname }}
register: result
until: result.rc == '0'
retries: 5
delay: 5
Note on the until: line, I should have been written it as result.rc =='0'.
When I said it didn't work, I meant that at the end of my test, I saw:
msg: Task failed as maximum retries was encountered
FATAL: all hosts have already failed -- aborting
That's just as ugly :( I don't have an idea how to make a "normal" play
termination yet. Any hints appreciated.
-- Zack
On Saturday, July 12, 2014 11:41:58 AM UTC-7, zperry wrote:
>
> 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
> [...]
>
>>
--
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/8529a1c5-fdaa-4b8f-8d87-b696e7bc44b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.