# remote copy issue

**URL:** <https://forum.ansible.com/t/remote-copy-issue/36056>\
**Category:** Ansible Project\
**Created:** [December 1, 2021, 5:08pm UTC](https://forum.ansible.com/t/remote-copy-issue/36056 "2021-12-01T17:08:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rene\_Paquin](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@Rene\_Paquin](https://forum.ansible.com/u/Rene_Paquin)\
**Post date:** [December 1, 2021, 5:08pm UTC](https://forum.ansible.com/t/remote-copy-issue/36056/1 "2021-12-01T17:08:45Z")

</div>

I am attemping o copy a file from one remote linux server to two remote linux servers. My playbook is:

- name: copy file

hosts: “remote source server”

gather\_facts: false

tasks:

- name: "copy "

copy:

src: /opt/odrive/alc/library/libraryusername.csv

remote\_src: yes

dest: /var/alc

delegate\_to: destination server 1

check\_mode: yes

- name: "copy "

copy:

src: /opt/odrive/alc/library/libraryusername.csv

remote\_src: yes

dest: /var/alc

delegate\_to: destination server 2

check\_mode: yes

I get the following error despite the file being there.

“msg”: “Source /opt/odrive/alc/library/libraryusername.csv not found”

What am I missing?

Thank you,

---

<div class="post-metadata">

**Author:** ![dulhaver](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dulhaver/32/1061_2.png) [@dulhaver](https://forum.ansible.com/u/dulhaver)\
**Post date:** [December 1, 2021, 5:51pm UTC](https://forum.ansible.com/t/remote-copy-issue/36056/2 "2021-12-01T17:51:06Z")

</div>

I am attemping o copy a file from one remote linux server to two remote linux servers. My playbook is:

- name: copy file

hosts: “remote source server”

gather\_facts: false

tasks:

- name: "copy "

copy:

src: /opt/odrive/alc/library/libraryusername.csv

remote\_src: yes

dest: /var/alc

delegate\_to: destination server 1

check\_mode: yes

- name: "copy "

copy:

src: /opt/odrive/alc/library/libraryusername.csv

remote\_src: yes

dest: /var/alc

delegate\_to: destination server 2

check\_mode: yes

I get the following error despite the file being there.

“msg”: “Source /opt/odrive/alc/library/libraryusername.csv not found”

What am I missing?

Thank you,

---

<div class="post-metadata">

**Author:** ![Rene\_Paquin](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@Rene\_Paquin](https://forum.ansible.com/u/Rene_Paquin)\
**Post date:** [December 1, 2021, 5:57pm UTC](https://forum.ansible.com/t/remote-copy-issue/36056/3 "2021-12-01T17:57:13Z")

</div>

Thank you for the response. I made the change but still getting the same error.

Rene

---

<div class="post-metadata">

**Author:** ![Rene\_Paquin](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@Rene\_Paquin](https://forum.ansible.com/u/Rene_Paquin)\
**Post date:** [December 1, 2021, 6:51pm UTC](https://forum.ansible.com/t/remote-copy-issue/36056/4 "2021-12-01T18:51:35Z")

</div>

Further to this I created a quick check for file playbook as below and it does find it and displays the content successfully. So the copy script is just not functional. Any ideas as to why it does not find the file?

- name: check if file exists

hosts: source server

gather\_facts: true

tasks:

- stat:

path: /opt/odrive/alc/library

register: result

- slurp:

src: /opt/odrive/alc/library/libraryusername.csv

register: result

when: result.stat.exists

- debug:

msg: “{{ result.content|b64decode }}”

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [December 2, 2021, 9:42am UTC](https://forum.ansible.com/t/remote-copy-issue/36056/5 "2021-12-02T09:42:16Z")

</div>

> I am attemping o copy a file from one remote linux server to two remote linux servers. My playbook is:
> 
> - name: copy file
> 
> hosts: “remote source server”
> 
> gather\_facts: false
> 
> tasks:
> 
> ```
> \- name: &quot;copy &quot;
> 
> copy:
> 
> src: /opt/odrive/alc/library/libraryusername\.csv
> 
> remote\_src: yes
> 
> dest: /var/alc
> 
> delegate\_to: destination server 1
> 
> check\_mode: yes
> 
> \- name: &quot;copy &quot;
> 
> copy:
> 
> src: /opt/odrive/alc/library/libraryusername\.csv
> 
> remote\_src: yes
> 
> dest: /var/alc
> 
> delegate\_to: destination server 2
> 
> check\_mode: yes
> 
> ```
> 
> I get the following error despite the file being there.
> 
> "msg": "Source /opt/odrive/alc/library/libraryusername.csv not found"
> 
> What am I missing?

The copy module only supports the controller or target itself (remote\_src) for the source file.

Take a look at the synchronize module if you want copy from one target to another.

Regards

```
         Racke

```

---

<div class="post-metadata">

**Author:** ![Rene\_Paquin](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@Rene\_Paquin](https://forum.ansible.com/u/Rene_Paquin)\
**Post date:** [December 2, 2021, 7:35pm UTC](https://forum.ansible.com/t/remote-copy-issue/36056/6 "2021-12-02T19:35:13Z")

</div>

I have changed my playbook to use the sync module. But again I am getting errors. Check mode is so I can test before the actual sync. I am using the ansible.posix.synchronize module which I downloaded and installed.

Playbook
