# Transfer files from Server A to Server B

**URL:** <https://forum.ansible.com/t/transfer-files-from-server-a-to-server-b/34933>\
**Category:** Ansible Project\
**Created:** [April 8, 2021, 1:49am UTC](https://forum.ansible.com/t/transfer-files-from-server-a-to-server-b/34933 "2021-04-08T01:49:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shivam\_Arora](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Shivam\_Arora](https://forum.ansible.com/u/Shivam_Arora)\
**Post date:** [April 8, 2021, 1:49am UTC](https://forum.ansible.com/t/transfer-files-from-server-a-to-server-b/34933/1 "2021-04-08T01:49:17Z")

</div>

Hi Community Members,

I am writing an Ansible playbook for which I want to copy files directly from Server A to Server B directly, skipping the Ansible node, i.e., I do not want to use Fetch and Copy module. I have tried the synchronize module to do the said task but however, it fails with the following error:  
"item", "changed": false, "cmd": "sshpass", "item":ABC.csv "msg": "[Errno 2] No such file or directory", "rc": 2}​​​​​​\nfailed

If anyone has done something similar, can you guide us how we can accomplish this? Any help is appreciated.

Thanks  
Shivam

---

<div class="post-metadata">

**Author:** ![Raj](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@Raj](https://forum.ansible.com/u/Raj)\
**Post date:** [April 8, 2021, 2:06am UTC](https://forum.ansible.com/t/transfer-files-from-server-a-to-server-b/34933/2 "2021-04-08T02:06:13Z")

</div>

Hi…

You can use fetch and copy… clean up on control node in same playbook . We are doing for security files…

Thanks

---

<div class="post-metadata">

**Author:** ![Abdulrazzaq\_shaik](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@Abdulrazzaq\_shaik](https://forum.ansible.com/u/Abdulrazzaq_shaik)\
**Post date:** [September 17, 2021, 5:55pm UTC](https://forum.ansible.com/t/transfer-files-from-server-a-to-server-b/34933/3 "2021-09-17T17:55:21Z")

</div>

Hi Raja

Can you please share a sample playbook where you need to fetch files from one node and transfer those file to multiple nodes.

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [September 18, 2021, 7:11am UTC](https://forum.ansible.com/t/transfer-files-from-server-a-to-server-b/34933/4 "2021-09-18T07:11:27Z")

</div>

> Hi Raja
> 
> Can you please share a sample playbook where you need to fetch files from one node and transfer those file to multiple nodes.

It looks like the sshpass binary is missing, probably on the controller.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![steve\_missoh](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@steve\_missoh](https://forum.ansible.com/u/steve_missoh)\
**Post date:** [September 18, 2021, 11:09pm UTC](https://forum.ansible.com/t/transfer-files-from-server-a-to-server-b/34933/5 "2021-09-18T23:09:11Z")

</div>

Dear Raja,  
do remember:

1. Use delegate\_to in order to make synchronize module moves between managed nodes
2. from serverA to serverB you should ensure a connection mechanism is in place, preferably non interactive. For e.g. ssh passwordless

example playbook:
