# Ansible 2.0: Synchronize module is hanging

**URL:** <https://forum.ansible.com/t/ansible-2-0-synchronize-module-is-hanging/19532>\
**Category:** Ansible Developer\
**Created:** [October 16, 2015, 9:43pm UTC](https://forum.ansible.com/t/ansible-2-0-synchronize-module-is-hanging/19532 "2015-10-16T21:43:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Corwin\_Brown](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@Corwin\_Brown](https://forum.ansible.com/u/Corwin_Brown)\
**Post date:** [October 16, 2015, 9:43pm UTC](https://forum.ansible.com/t/ansible-2-0-synchronize-module-is-hanging/19532/1 "2015-10-16T21:43:56Z")

</div>

Hey gang,

I’ve been having some issues with the synchronize module in v2. Here’s the code that calls it:

`

- name: Install to Publish Directory  
synchronize:  
src: “{{ tmp\_dir }}/”  
dest: “{{ publish\_directory }}/{{ instance\_name }}”  
delete: yes  
recursive: yes  
mode: push  
delegate\_to: “{{ inventory\_hostname }}”  
`

This gets called and just hangs with this output:

`  
TASK [restcs\_deploy : Install to Publish Directory] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /opt/ansible/release/roles/restcs\_deploy/tasks/install.yml:2  
[WARNING]: no remote address found for delegated host [rundeck.datacenter.company.com](http://rundeck.datacenter.company.com), using its name by default

\<[rundeck.datacenter.company.com](http://rundeck.datacenter.company.com)\> ESTABLISH CONNECTION FOR USER: user on PORT 22 TO [rundeck.atxd.maxpointinteractive.com](http://rundeck.atxd.maxpointinteractive.com)  
\<[rundeck.datacenter.company.com](http://rundeck.datacenter.company.com)\> EXEC (umask 22 && mkdir -p “$(echo $HOME/.ansible/tmp/ansible-tmp-1445025738.21-448766273520)” && echo “$(echo $HOME/.ansible/tmp/ansible-tmp-1445025738.21-448766273520)”)  
\<[rundeck.datacenter.company.com](http://rundeck.datacenter.company.com)\> PUT /tmp/tmpG49x7R TO /home/user/.ansible/tmp/ansible-tmp-1445025738.21-448766273520/synchronize  
\<[rundeck.datacenter.company.com](http://rundeck.datacenter.company.com)\> EXEC /bin/sh -c ‘sudo -H -p “[sudo via ansible, key=uaprwqkxcglkzwhmgqgrqxrnevnleaum] password: " -S -u root /bin/sh -c '”’“‘echo BECOME-SUCCESS-uaprwqkxcglkzwhmgqgrqxrnevnleaum; LANG=C LC\_MESSAGES=C LC\_CTYPE=C /usr/bin/python /home/user/.ansible/tmp/ansible-tmp-1445025738.21-448766273520/synchronize; rm -rf “/home/user/.ansible/tmp/ansible-tmp-1445025738.21-448766273520/” \> /dev/null 2\>&1’”‘"’’  
^CProcess WorkerProcess-5:  
Traceback (most recent call last):  
File “/usr/lib/python2.7/multiprocessing/process.py”, line 258, in \_bootstrap  
self.run()  
File “/opt/ansible-src/lib/ansible/executor/process/worker.py”, line 100, in run  
(host, task, basedir, job\_vars, play\_context, shared\_loader\_obj) = self.\_main\_q.get()  
`

I included the stacktrace from the Control-C in case that’s helpful, but that hung like that for about an hour. I tried to merge in:

[https://github.com/ansible/ansible/pull/12783](https://github.com/ansible/ansible/pull/12783)

But I’m still having the issue. It’s worth noting that the playbook does have “become: yes”, and I’m proxying through a jumphost, but all of this works fine in 1.9

Any Thoughts?

---

<div class="post-metadata">

**Author:** ![Mark\_Chance](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@Mark\_Chance](https://forum.ansible.com/u/Mark_Chance)\
**Post date:** [November 5, 2015, 9:25pm UTC](https://forum.ansible.com/t/ansible-2-0-synchronize-module-is-hanging/19532/2 "2015-11-05T21:25:24Z")

</div>

Corwin:  
I had this problem also… including sometimes not giving any output at all…  
In my case, i had a with\_items clause and what seemed to help was to add a when clause above the with\_items and verify all the attributes are defined.

The other thing i’ve found with delegate\_to is having all the variables defined for that host.

So what you might try to confirm/deny this is:

- name: Install to Publish Directory  
debug: var=tmp\_dir  
delegate\_to: “{{ inventory\_hostname }}”

- name: Install to Publish Directory  
debug: var=instance\_name  
delegate\_to: “{{ inventory\_hostname }}”

- name: Install to Publish Directory  
debug: var=publish\_directory  
delegate\_to: “{{ inventory\_hostname }}”

That’s my $0.02… good luck.
