It still continues on after failing, it just does so one host at a time.

PLAY [Ping] 
******************************************************************************************************************************************************************

TASK [Ping Servers] 
**********************************************************************************************************************************************************
fatal: [myhost1]: UNREACHABLE! => {"changed": false, "msg": "Data could not 
be sent to remote host \"myhost1\". Make sure this host can be reached over 
ssh: ", "unreachable": true}

NO MORE HOSTS LEFT 
***********************************************************************************************************************************************************

NO MORE HOSTS LEFT 
***********************************************************************************************************************************************************

PLAY [Ping] 
******************************************************************************************************************************************************************

TASK [Ping Servers] 
**********************************************************************************************************************************************************
fatal: [myhost2]: UNREACHABLE! => {"changed": false, "msg": "Data could not 
be sent to remote host \"myhost2\". Make sure this host can be reached over 
ssh: ", "unreachable": true}

NO MORE HOSTS LEFT 
***********************************************************************************************************************************************************

NO MORE HOSTS LEFT 
***********************************************************************************************************************************************************

PLAY [Ping] 
******************************************************************************************************************************************************************

TASK [Ping Servers] 
**********************************************************************************************************************************************************
...
On Wednesday, March 10, 2021 at 3:44:50 PM UTC-6 [email protected] wrote:

>
>
> What happens if you add serial:1 and max_fail_percentage:1 and removing 
> any_errors_fatal directive? 
>
> On Wed, Mar 10, 2021, 21:35 Mark Faine <[email protected]> wrote:
>
>>
>> I'm trying to ping servers and fail immediately at the first one that is 
>> unreachable.  However, this doesn't seem to work.  I found this old issue 
>> about it but apparently it hasn't been resolved.  
>> https://github.com/ansible/ansible/issues/16475
>>
>> ---
>> - name: Ping
>>   hosts: all
>>   gather_facts: false
>>   any_errors_fatal: true
>>   tasks:
>>     - name: Ping Servers
>>       ping:
>>
>> I've purposely poisoned the inventory and yet it just says those hosts 
>> are unreachable and continues on its way, it should fail at the first 
>> unreachable host.
>>
>> Thanks,
>> -Mark
>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/a8fdae92-0d13-4e80-a993-ba2e0b25e4bcn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/a8fdae92-0d13-4e80-a993-ba2e0b25e4bcn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2f4c4fbd-ad38-494f-a04c-214788f0fedan%40googlegroups.com.

Reply via email to