# Ansible Synchronization Problem

**URL:** <https://forum.ansible.com/t/ansible-synchronization-problem/34579>\
**Category:** Ansible Project\
**Created:** [February 5, 2021, 6:43pm UTC](https://forum.ansible.com/t/ansible-synchronization-problem/34579 "2021-02-05T18:43:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Subhi\_Andrews](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@Subhi\_Andrews](https://forum.ansible.com/u/Subhi_Andrews)\
**Post date:** [February 5, 2021, 6:43pm UTC](https://forum.ansible.com/t/ansible-synchronization-problem/34579/1 "2021-02-05T18:43:17Z")

</div>

As a part of getting a bunch of nodes ready and configured for our environment, I need to copy a file from already configured node. Let call the already configured node **{{ dis\_host }}** with actual host name **pfch3dis99**. Here’s my playbook:

_- name: MySQL Playbook_  
_hosts: irisprep_  
_vars:_  
_env: “{{ iris\_env }}”_  
_mysql\_path: /etc/sysconfig/myapp/java\_lib/mysql-connector-java-5.1.43-bin.jar_  
_vars\_files:_  
_- variables.yml_  
_tasks:_  
_- name: Synchronize mysql connector from dis host_  
_synchronize:_  
_mode: pull_  
_src: “{{ mysql\_path }}”_  
_dest: “{{ mysql\_path }}”_  
_recursive: no_  
_delegate\_to: “{{ dis\_host }}”_  
_become: yes_

Host group **irisprep** has all the hosts I want to run the playbook on. **pfch3calc98** happens to be one of the hosts part of the host group. It keeps giving me a failure. with the following error:

_File “/tmp/ansible\_ansible.posix.synchronize\_payload\_H65x9J/ansible\_ansible.posix.synchronize\_payload.zip/ansible/module\_utils/basic.py”, line 2710, in run\_command_  
_cmd = subprocess.Popen(args, \*\*kwargs)_  
_File “/usr/lib64/python2.7/subprocess.py”, line 711, in **init** _  
_errread, errwrite)_  
_File “/usr/lib64/python2.7/subprocess.py”, line 1327, in \_execute\_child_  
_raise child\_exception_  
_fatal: [pfch3calc98 → pfch3dis99]: FAILED! =\> {_  
_“changed”: false,_  
_“cmd”: “sshpass”,_  
_“invocation”: {_  
_“module\_args”: {_  
_“\_local\_rsync\_password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,_  
_“\_local\_rsync\_path”: “rsync”,_  
_“\_substitute\_controller”: false,_  
_“archive”: true,_  
_“checksum”: false,_  
_“compress”: true,_  
_“copy\_links”: false,_  
_“delete”: false,_  
_“dest”: “/etc/sysconfig/myapp/java\_lib/mysql-connector-java-5.1.43-bin.jar”,_  
_“dest\_port”: null,_  
_“dirs”: false,_  
_“existing\_only”: false,_  
_“group”: null,_  
_“link\_dest”: null,_  
_“links”: null,_  
_“mode”: “pull”,_  
_“owner”: null,_  
_“partial”: false,_  
_“perms”: null,_  
_“private\_key”: null,_  
_“recursive”: false,_  
_“rsync\_opts”: [],_  
_“rsync\_path”: “sudo rsync”,_  
_“rsync\_timeout”: 0,_  
_“set\_remote\_user”: true,_  
_“src”: “myuser@pfch3calc98:/etc/sysconfig/myapp/java\_lib/mysql-connector-java-5.1.43-bin.jar”,_  
_“ssh\_args”: null,_  
_“times”: null,_  
_“verify\_host”: false_  
_}_  
_},_  
_“msg”: “[Errno 2] No such file or directory”,_  
_“rc”: 2_  
_}_

I can’t seem to figure out what’s going on. Anyone see something that my eyes are not spotting?

Thanks a lot,  
Subhi.

---

<div class="post-metadata">

**Author:** ![vinod93pop](https://avatars.discourse-cdn.com/v4/letter/v/ea5d25/32.png) [@vinod93pop](https://forum.ansible.com/u/vinod93pop)\
**Post date:** [February 8, 2021, 5:26pm UTC](https://forum.ansible.com/t/ansible-synchronization-problem/34579/2 "2021-02-08T17:26:47Z")

</div>

Error says no file . Which means target file is not available and it’s checking in wrong host as you don’t want . Also when you delegate to some host that to be source and copy from there to your play host you have to use some thing like this .

In your output it searches on your play host server

_myuser@pfch3calc98:/etc/sysconfig/myapp/java\_lib/mysql-connector-java-5.1.43-bin.jar",_

Use like this .

```auto
# Synchronization using rsync protocol on delegate host (pull)
- synchronize:
    mode: pull
    src: rsync://[somehost.com/path/](http://somehost.com/path/)
    dest: /some/absolute/path/
  delegate_to: delegate.host

```

```auto

```

//v
