# Cannot copy the files from local/repo to GCP vm

**URL:** <https://forum.ansible.com/t/cannot-copy-the-files-from-local-repo-to-gcp-vm/42244>\
**Category:** Get Help\
**Tags:** gcp, playbook, awx\
**Created:** [April 28, 2025, 9:27pm UTC](https://forum.ansible.com/t/cannot-copy-the-files-from-local-repo-to-gcp-vm/42244 "2025-04-28T21:27:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SaravanaSelvaraj](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/saravanaselvaraj/32/2841_2.png) [@SaravanaSelvaraj](https://forum.ansible.com/u/SaravanaSelvaraj)\
**Post date:** [April 28, 2025, 9:27pm UTC](https://forum.ansible.com/t/cannot-copy-the-files-from-local-repo-to-gcp-vm/42244/1 "2025-04-28T21:27:51Z")

</div>

\*\*Cannot copy the files using copy module from local to GCP Vm instances \*\*.

Dear community ,

I am using a custom plugin to connect to GCP and do SSH/SCP. The plugin I am using is here. [GitHub - thenets/demo-ansible-gcp-iap: How connect Ansible using GCP IAP](https://github.com/thenets/demo-ansible-gcp-iap).

The problem is when I use copy module, it throws this error to me.

```auto
   - name: Copying sample.txt
      copy: 
         src: ./files/sample.txt
         dest/opt/sample.txt
      become: yes
      run_once: true

```

The error i see is

```auto
msg": "Could not find or access './files/sample.txt'\nSearched in:\n\t/runner/project/files/./files/sample.txt\n\t/runner/project/./files/sample.txt\n\t/runner/project/files/./files/sample.txt\n\t/runner/project/./files/sample.txt on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option",

```

Also I created an issue to the author here . [Cannot use copy module with this plugin · Issue #4 · thenets/demo-ansible-gcp-iap · GitHub](https://github.com/thenets/demo-ansible-gcp-iap/issues/4)

Could you please help ?

---

<div class="post-metadata">

**Author:** ![SaravanaSelvaraj](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/saravanaselvaraj/32/2841_2.png) [@SaravanaSelvaraj](https://forum.ansible.com/u/SaravanaSelvaraj)\
**Post date:** [April 28, 2025, 9:28pm UTC](https://forum.ansible.com/t/cannot-copy-the-files-from-local-repo-to-gcp-vm/42244/2 "2025-04-28T21:28:39Z")

</div>

@kurokobo , @bcoca and @wayt . Please help if you can here.

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [April 28, 2025, 11:51pm UTC](https://forum.ansible.com/t/cannot-copy-the-files-from-local-repo-to-gcp-vm/42244/3 "2025-04-28T23:51:52Z")

</div>

It’s a good idea to carefully read the error message, compare your code with the path mentioned in the error message, and try out different patterns.

Also refer to:

> **[Search paths in Ansible — Ansible Community Documentation](https://docs.ansible.com/ansible/latest/playbook_guide/playbook_pathing.html)**

---

<div class="post-metadata">

**Author:** ![SaravanaSelvaraj](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/saravanaselvaraj/32/2841_2.png) [@SaravanaSelvaraj](https://forum.ansible.com/u/SaravanaSelvaraj)\
**Post date:** [April 29, 2025, 4:19am UTC](https://forum.ansible.com/t/cannot-copy-the-files-from-local-repo-to-gcp-vm/42244/4 "2025-04-29T04:19:40Z")

</div>

Thanks alot for the response. I will check and comeback to you.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [May 29, 2025, 4:19am UTC](https://forum.ansible.com/t/cannot-copy-the-files-from-local-repo-to-gcp-vm/42244/5 "2025-05-29T04:19:53Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
