# Copy a folder from remote host to local using Ansible.

**URL:** <https://forum.ansible.com/t/copy-a-folder-from-remote-host-to-local-using-ansible/32970>\
**Category:** Ansible Project\
**Created:** [May 19, 2020, 12:41pm UTC](https://forum.ansible.com/t/copy-a-folder-from-remote-host-to-local-using-ansible/32970 "2020-05-19T12:41:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Divya\_Punna](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@Divya\_Punna](https://forum.ansible.com/u/Divya_Punna)\
**Post date:** [May 19, 2020, 12:41pm UTC](https://forum.ansible.com/t/copy-a-folder-from-remote-host-to-local-using-ansible/32970/1 "2020-05-19T12:41:30Z")

</div>

Can anyone help/suggest on how to copy a folder from remote host to local using Ansible? Appreciate any quick help on this

---

<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:** [May 19, 2020, 1:35pm UTC](https://forum.ansible.com/t/copy-a-folder-from-remote-host-to-local-using-ansible/32970/2 "2020-05-19T13:35:50Z")

</div>

> Can anyone help/suggest on how to copy a folder from remote host to local using Ansible? Appreciate any quick help on this

What about synchronize module?

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

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [May 19, 2020, 1:55pm UTC](https://forum.ansible.com/t/copy-a-folder-from-remote-host-to-local-using-ansible/32970/3 "2020-05-19T13:55:30Z")

</div>

Try

&nbsp;&nbsp;- hosts: remote\_host  
&nbsp;&nbsp;&nbsp;&nbsp;tasks:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- synchronize:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mode: pull  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;src: "{{ dir\_on\_remote\_host }}"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dest: "{{ dir\_on\_localhost }}"
