# how to synchronize files or Dir between different remote hosts?

**URL:** <https://forum.ansible.com/t/how-to-synchronize-files-or-dir-between-different-remote-hosts/23385>\
**Category:** Ansible Project\
**Created:** [January 5, 2017, 8:30am UTC](https://forum.ansible.com/t/how-to-synchronize-files-or-dir-between-different-remote-hosts/23385 "2017-01-05T08:30:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![user117](https://avatars.discourse-cdn.com/v4/letter/u/258eb7/32.png) [@user117](https://forum.ansible.com/u/user117)\
**Post date:** [January 5, 2017, 8:30am UTC](https://forum.ansible.com/t/how-to-synchronize-files-or-dir-between-different-remote-hosts/23385/1 "2017-01-05T08:30:45Z")

</div>

how to synchronize files or Dir between different remote hosts?

if there are 2 hosts: s1 and s2, and ansible running at s3,  
how to synchronize dirs on s1 and s2？

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [January 6, 2017, 8:34pm UTC](https://forum.ansible.com/t/how-to-synchronize-files-or-dir-between-different-remote-hosts/23385/2 "2017-01-06T20:34:33Z")

</div>

First thought: Sync from s1 to s3 (put it somewhere on the controller)  
and then sync this to s2.

Syncing directly via e.g. rsync might cause trouble with ssh-keys,  
agents and stuff like that.

But I never had the need to actually do this, maybe someone else  
already has...

Johannes
