# execute Synchronize module in AAP 2.3

**URL:** <https://forum.ansible.com/t/execute-synchronize-module-in-aap-2-3/38625>\
**Category:** Ansible Project\
**Tags:** aap, ansible-project\
**Created:** [December 13, 2023, 10:56am UTC](https://forum.ansible.com/t/execute-synchronize-module-in-aap-2-3/38625 "2023-12-13T10:56:23Z")\
**Posts on this page:** 9\
**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:** [December 13, 2023, 10:56am UTC](https://forum.ansible.com/t/execute-synchronize-module-in-aap-2-3/38625/1 "2023-12-13T10:56:23Z")

</div>

Hello experts

I ve simple piece of below code

```auto
    - Name: Install rsync on the Target
      package:
        name: rsync
        state: present
    
    - Name: Synchronize file from local to remote   
      synchronize:
         src: /tmp/memo.txt
         dest: /temp/test

```

code I can run the code using ansible-playbook command but when I am executing it via ansible automation platform gui it is giving me the below error  
Message . No file error.

---

<div class="post-metadata">

**Author:** ![Walter\_Rowe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/walter_rowe/32/4506_2.png) [@Walter\_Rowe](https://forum.ansible.com/u/Walter_Rowe)\
**Post date:** [December 13, 2023, 12:56pm UTC](https://forum.ansible.com/t/execute-synchronize-module-in-aap-2-3/38625/2 "2023-12-13T12:56:08Z")

</div>

AAP uses execution environments which are containers. If /tmp/memo.txt is not known to the container the task will fail.

Walter

---

<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:** [December 13, 2023, 1:23pm UTC](https://forum.ansible.com/t/execute-synchronize-module-in-aap-2-3/38625/3 "2023-12-13T13:23:51Z")

</div>

Hii  
If it really is just one file, you can use the copy module…

---

<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:** [December 13, 2023, 1:43pm UTC](https://forum.ansible.com/t/execute-synchronize-module-in-aap-2-3/38625/4 "2023-12-13T13:43:17Z")

</div>

Thank you for your direction and suggestion…  
actually we want to sync http folder not a file  
Is there any way I can sync between 2 servers.?

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:** [December 13, 2023, 1:51pm UTC](https://forum.ansible.com/t/execute-synchronize-module-in-aap-2-3/38625/5 "2023-12-13T13:51:55Z")

</div>

You can, with the synchronize module. But as explained above, your specific setup includes containers, so that needs some work. What exactly depends on your setup, if you can mount volumes, etc. Something that is known to you. IIRC the product you are using (AAP) includes support, so that would be the most logical thing to try.

If you folder is not too big you can still use the copy module:

[https://docs.ansible.com/ansible/latest/collections/ansible/builtin/copy\_module.html#parameter-src](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/copy_module.html#parameter-src)

You should experiment a bit with that.

---

<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:** [December 13, 2023, 2:19pm UTC](https://forum.ansible.com/t/execute-synchronize-module-in-aap-2-3/38625/6 "2023-12-13T14:19:34Z")

</div>

Hi Dick

Thank you for the directions. If I not wrong all AAP uses containers to execute the templates and this is not specific to me. I m not sure why ansible AAP provided which does not work in the out of box bundle. let me chk with RH support…  
Thank a lot again…

---

<div class="post-metadata">

**Author:** ![Walter\_Rowe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/walter_rowe/32/4506_2.png) [@Walter\_Rowe](https://forum.ansible.com/u/Walter_Rowe)\
**Post date:** [December 13, 2023, 3:24pm UTC](https://forum.ansible.com/t/execute-synchronize-module-in-aap-2-3/38625/7 "2023-12-13T15:24:25Z")

</div>

If the files to sync are part of the project that includes the playbook then it is present inside the container. If the files / folder to sync reside elsewhere, you need to delegate that task(s) to that source system where they reside that you want to sync.

Walter

---

<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:** [December 14, 2023, 1:17am UTC](https://forum.ansible.com/t/execute-synchronize-module-in-aap-2-3/38625/8 "2023-12-14T01:17:46Z")

</div>

Thanks a Ton Walter and dick  
Delegate option filnlally worked…  
I wonder how copy module works even though the concept are same.

Regards  
PD

---

<div class="post-metadata">

**Author:** ![Walter\_Rowe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/walter_rowe/32/4506_2.png) [@Walter\_Rowe](https://forum.ansible.com/u/Walter_Rowe)\
**Post date:** [December 14, 2023, 1:46pm UTC](https://forum.ansible.com/t/execute-synchronize-module-in-aap-2-3/38625/9 "2023-12-14T13:46:58Z")

</div>

> I wonder how copy module works even though the concept are same.

Again, if the source is part of the project then it will be visible to the playbook. If it is not you need to delegate\_to the source host and provide the correct source path for the source host.

Walter
