# {{dest\_file}} only shows output of one host instead of 2 as I was expecting

**URL:** <https://forum.ansible.com/t/dest-file-only-shows-output-of-one-host-instead-of-2-as-i-was-expecting/36441>\
**Category:** Ansible Project\
**Created:** [March 15, 2022, 1:00pm UTC](https://forum.ansible.com/t/dest-file-only-shows-output-of-one-host-instead-of-2-as-i-was-expecting/36441 "2022-03-15T13:00:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnc](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@johnc](https://forum.ansible.com/u/johnc)\
**Post date:** [March 15, 2022, 1:00pm UTC](https://forum.ansible.com/t/dest-file-only-shows-output-of-one-host-instead-of-2-as-i-was-expecting/36441/1 "2022-03-15T13:00:29Z")

</div>

hi guys, the below playbook seems to work ok except when the ouput gets written to the local file, it only shows the output of one host instead of 2 that I was expecting.

What needs to change so that I can have the output for both hosts in perf.

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [March 21, 2022, 3:39pm UTC](https://forum.ansible.com/t/dest-file-only-shows-output-of-one-host-instead-of-2-as-i-was-expecting/36441/2 "2022-03-21T15:39:28Z")

</div>

You are effectively overwriting the file with the contents of each host, onto localhost.

Ultimately you will need differently named files, or do something more complex using a template and `run_once: true` and inside the template looping all hosts, getting their `output`, and putting it in the file.
