# Synchronize module failing

**URL:** <https://forum.ansible.com/t/synchronize-module-failing/38585>\
**Category:** Ansible Project\
**Created:** [November 16, 2023, 12:56pm UTC](https://forum.ansible.com/t/synchronize-module-failing/38585 "2023-11-16T12:56:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prady\_A](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/prady_a/32/4792_2.png) [@Prady\_A](https://forum.ansible.com/u/Prady_A)\
**Post date:** [November 16, 2023, 12:56pm UTC](https://forum.ansible.com/t/synchronize-module-failing/38585/1 "2023-11-16T12:56:01Z")

</div>

Hi Experts

One doubt with synchronize module

- name: Unix common script deployment  
synchronize:  
src: “{{ playbook\_dir }}/shellscript”  
Dest: /tmp/patch\_impl  
delegation\_to: all

In this ansible code it is failing because to run synchronize we need rsynch module in both control as well as managed nodes. But to overcome that can we use container method? Inside the requirement.txt can we add rsync module to build a image out it and use in the template?

My container file structure

1. \_build/requirement.txt
2. Contanerfile
3. krb5.conf
4. pip.conf
5. uib.repo

Regards  
Prady

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [November 16, 2023, 1:10pm UTC](https://forum.ansible.com/t/synchronize-module-failing/38585/2 "2023-11-16T13:10:01Z")

</div>

You can use whatever you want, as long as there will be a working rsync command on both control and managed nodes.

Dick

---

<div class="post-metadata">

**Author:** ![Prady\_A](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/prady_a/32/4792_2.png) [@Prady\_A](https://forum.ansible.com/u/Prady_A)\
**Post date:** [November 16, 2023, 1:23pm UTC](https://forum.ansible.com/t/synchronize-module-failing/38585/3 "2023-11-16T13:23:49Z")

</div>

Thank you for your kind reply

No some target machine don’t have rsync installed.  
What to do in that case ?

Regards

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [November 16, 2023, 1:36pm UTC](https://forum.ansible.com/t/synchronize-module-failing/38585/4 "2023-11-16T13:36:34Z")

</div>

Hi,

> Thank you for your kind reply
> 
> No some target machine don’t have rsync installed.  
> What to do in that case ?

install rsync on the target machines before using the synchronize  
module. (For example using the ansible.builtin.package action:  
[https://docs.ansible.com/ansible/latest/collections/ansible/builtin/package\_module.html.](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/package_module.html.))

Best regards,  
Felix

---

<div class="post-metadata">

**Author:** ![Prady\_A](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/prady_a/32/4792_2.png) [@Prady\_A](https://forum.ansible.com/u/Prady_A)\
**Post date:** [November 17, 2023, 12:35am UTC](https://forum.ansible.com/t/synchronize-module-failing/38585/5 "2023-11-17T00:35:09Z")

</div>

Thank you for your guidance …

Regards  
Prady
