# Get host name of the servers where the task failed

**URL:** <https://forum.ansible.com/t/get-host-name-of-the-servers-where-the-task-failed/31089>\
**Category:** Ansible Project\
**Created:** [August 21, 2019, 2:16pm UTC](https://forum.ansible.com/t/get-host-name-of-the-servers-where-the-task-failed/31089 "2019-08-21T14:16:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pandu\_jh](https://avatars.discourse-cdn.com/v4/letter/p/3bc359/32.png) [@Pandu\_jh](https://forum.ansible.com/u/Pandu_jh)\
**Post date:** [August 21, 2019, 2:16pm UTC](https://forum.ansible.com/t/get-host-name-of-the-servers-where-the-task-failed/31089/1 "2019-08-21T14:16:55Z")

</div>

I have a task in my playbook where it runs against multiple servers.  
I need to get the hostname of all servers where my task failed and append it to a variable as a list.  
Please assist how to get this.

---

<div class="post-metadata">

**Author:** ![vinod93pop](https://avatars.discourse-cdn.com/v4/letter/v/ea5d25/32.png) [@vinod93pop](https://forum.ansible.com/u/vinod93pop)\
**Post date:** [August 21, 2019, 2:57pm UTC](https://forum.ansible.com/t/get-host-name-of-the-servers-where-the-task-failed/31089/2 "2019-08-21T14:57:00Z")

</div>

If you are running in ansible engine it will automatically create a file as yourplayboonname.retry in same folder
