# Synchronize command not working when upgraded to Ansible 2.1.0

**URL:** <https://forum.ansible.com/t/synchronize-command-not-working-when-upgraded-to-ansible-2-1-0/21922>\
**Category:** Ansible Project\
**Created:** [July 5, 2016, 1:18pm UTC](https://forum.ansible.com/t/synchronize-command-not-working-when-upgraded-to-ansible-2-1-0/21922 "2016-07-05T13:18:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Lennon](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Michael\_Lennon](https://forum.ansible.com/u/Michael_Lennon)\
**Post date:** [July 5, 2016, 1:18pm UTC](https://forum.ansible.com/t/synchronize-command-not-working-when-upgraded-to-ansible-2-1-0/21922/1 "2016-07-05T13:18:49Z")

</div>

Hi,  
We were recently upgraded to Ansible 2.1.0, from 1.9.4 (I think). Now have an issue with any playbooks that make use of the synchronize module. I have a a test playbook that simply copies a text file from Host A to Host B and the job is delegated to Host C.

cat test\_connectivity.yml

- name: Copy the text file from /home/triarch/ansible\_test.txt to target host to check ansible connectivity  
hosts: ‘{{ target }}’  
remote\_user: triarch  
gather\_facts: no

tasks:

- name: copy over the test text file to /home/triarch  
synchronize: mode=push src=/tmp/ansible\_test.txt dest=/home/triarch  
delegate\_to: HostC

Output from running the playbook is;

[root@HostB]# ansible-playbook test\_connectivity.yml --extra-vars “target=HostB” -vvv  
Using /etc/ansible/ansible.cfg as config file  
1 plays in test\_connectivity.yml

PLAY [Copy the text file from /home/triarch/ansible\_test.txt to target host to check ansible connectivity] \*\*\*

TASK [copy over the test text file to /hostname/triarch] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /mnt/ansible/playbooks/mdi/test/test\_connectivity.yml:7  
 ESTABLISH SSH CONNECTION FOR USER: triarch  
 SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=triarch -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt HostC’/bin/sh -c ‘"’“‘( umask 22 && mkdir -p “`echo $HOME/.ansible/tmp/ansible-tmp-1467723381.55-23670874385865`” && echo “`echo $HOME/.ansible/tmp/ansible-tmp-1467723381.55-23670874385865`” )’”‘"’’  
 PUT /tmp/tmpL7jmA3 TO /home/triarch/.ansible/tmp/ansible-tmp-1467723381.55-23670874385865/synchronize  
 SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=triarch -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r ‘[HostC]’  
 ESTABLISH SSH CONNECTION FOR USER: triarch  
 SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=triarch -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt HostC’/bin/sh -c ‘"’“‘LANG=en\_US.UTF-8 LC\_ALL=en\_US.UTF-8 LC\_MESSAGES=en\_US.UTF-8 /usr/bin/python /home/triarch/.ansible/tmp/ansible-tmp-1467723381.55-23670874385865/synchronize; rm -rf “/home/triarch/.ansible/tmp/ansible-tmp-1467723381.55-23670874385865/” \> /dev/null 2\>&1’”‘"’’  
fatal: [HostB-\> HostC]: FAILED! =\> {“changed”: false, “cmd”: “/usr/bin/rsync --delay-updates -F --compress --archive --rsh ‘/etc/ssh -S none -o StrictHostKeyChecking=no -o Port=22’ --out-format=‘\<\>%i %n%L’ "/tmp/ansible\_test.txt" "HostB:/home/triarch"”, “failed”: true, “invocation”: {“module\_args”: {“\_local\_rsync\_path”: “rsync”, “\_substitute\_controller”: false, “archive”: true, “checksum”: false, “compress”: true, “copy\_links”: null, “delete”: false, “dest”: “HostB:/home/triarch”, “dest\_port”: “22”, “dirs”: false, “existing\_only”: false, “group”: null, “links”: null, “mode”: “push”, “owner”: null, “partial”: false, “perms”: null, “private\_key”: null, “recursive”: null, “rsync\_opts”: null, “rsync\_path”: null, “rsync\_timeout”: 0, “set\_remote\_user”: true, “src”: “/tmp/ansible\_test.txt”, “ssh\_args”: null, “times”: null, “verify\_host”: false}}, “msg”: “rsync: Failed to exec /etc/ssh: Permission denied (13)\nrsync error: error in IPC code (code 14) at pipe.c(84) [sender=3.0.4]\nrsync: connection unexpectedly closed (0 bytes received so far) [sender]\nrsync error: error in IPC code (code 14) at io.c(632) [sender=3.0.4]\n”, “rc”: 14}

NO MORE HOSTS LEFT \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
to retry, use: --limit @test\_connectivity.retry

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
HostB : ok=0 changed=0 unreachable=0 failed=1

Any ideas?

Thanks,

Mick

---

<div class="post-metadata">

**Author:** ![jdelaporte](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jdelaporte/32/366_2.png) [@jdelaporte](https://forum.ansible.com/u/jdelaporte)\
**Post date:** [July 6, 2016, 3:35pm UTC](https://forum.ansible.com/t/synchronize-command-not-working-when-upgraded-to-ansible-2-1-0/21922/2 "2016-07-06T15:35:33Z")

</div>

Hi Mick,

The docs say that using push mode, the delegate is the source of the sync. So, your task is trying to ssh from HostC (the delegate) to HostB. Can these two hosts talk to each other? Maybe you meant to delegate\_to: HostA?

Joanna

---

<div class="post-metadata">

**Author:** ![Dick\_Davies](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dick\_Davies](https://forum.ansible.com/u/Dick_Davies)\
**Post date:** [July 7, 2016, 5:41pm UTC](https://forum.ansible.com/t/synchronize-command-not-working-when-upgraded-to-ansible-2-1-0/21922/3 "2016-07-07T17:41:11Z")

</div>

Something is screwy :

"Failed to exec /etc/ssh: Permission denied"
