# Sync module delete option not working

**URL:** <https://forum.ansible.com/t/sync-module-delete-option-not-working/33094>\
**Category:** Ansible Project\
**Created:** [June 4, 2020, 4:03pm UTC](https://forum.ansible.com/t/sync-module-delete-option-not-working/33094 "2020-06-04T16:03:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankit2](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@Ankit2](https://forum.ansible.com/u/Ankit2)\
**Post date:** [June 4, 2020, 4:03pm UTC](https://forum.ansible.com/t/sync-module-delete-option-not-working/33094/1 "2020-06-04T16:03:18Z")

</div>

Hello All,

I am trying to sync all files and directories between two directories however for some reason, **delete** option is not working. Following is my task, this works properly except when some directory is deleted fro source, the same is not deleted in destination even thought both **delete: yes** and **recursive: true** are set. Kindly suggest.

`

- name: “STEP 4: Synchronization of Updates from Repo to deploymet\_apps directory”  
synchronize:  
src: “{{ item }}”  
dest: “/home/DS/ads.anksharma/deployment-apps”  
delete: yes  
recursive: true  
with\_items: “{{ Files }}”  
delegate\_to: localhost  
`

**Output:**

`  
TASK [STEP 4: Synchronization of Updates from Repo to deployment\_apps directory] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost → localhost] =\> (item=/root/13532/deployment-apps/app\_demoapp)  
ok: [localhost → localhost] =\> (item=/root/13532/deployment-apps/app\_SPLWindowsinstall)  
ok: [localhost → localhost] =\> (item=/root/13532/deployment-apps/app\_test)  
ok: [localhost → localhost] =\> (item=/root/13532/deployment-apps/app\_SPLLinuxinstall)

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
localhost : ok=4 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

`
