# Collecting unreachable hosts list

**URL:** <https://forum.ansible.com/t/collecting-unreachable-hosts-list/34918>\
**Category:** Ansible Project\
**Created:** [April 6, 2021, 5:19am UTC](https://forum.ansible.com/t/collecting-unreachable-hosts-list/34918 "2021-04-06T05:19:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Somasundaram\_R](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@Somasundaram\_R](https://forum.ansible.com/u/Somasundaram_R)\
**Post date:** [April 6, 2021, 5:19am UTC](https://forum.ansible.com/t/collecting-unreachable-hosts-list/34918/1 "2021-04-06T05:19:01Z")

</div>

In my playbook, I have included a role in my first play to generate a report from template.  
And in my second play, updating same report.

When I keep both play in different file and run, both updating the file.  
But if both play are in same playbook, first play working fine. second play does not work.

Second play is about collecting unreachable hosts.  
Please help me to find the issue.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [April 6, 2021, 4:57pm UTC](https://forum.ansible.com/t/collecting-unreachable-hosts-list/34918/2 "2021-04-06T16:57:17Z")

</div>

use:  
- meta: clear\_host\_errors

At the end of your first play or your 2nd play will already remove  
unreachable hosts when creating the list to iterate over.

When you run in 2 different instances, the 'memory' of unreachable  
hosts is gone, that is why they work separately.
