# Unable to copy any file from ansible to Juniper switch

**URL:** <https://forum.ansible.com/t/unable-to-copy-any-file-from-ansible-to-juniper-switch/6298>\
**Category:** Get Help\
**Created:** [June 11, 2024, 10:16am UTC](https://forum.ansible.com/t/unable-to-copy-any-file-from-ansible-to-juniper-switch/6298 "2024-06-11T10:16:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![G24Joshi1](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/g24joshi1/32/3657_2.png) [@G24Joshi1](https://forum.ansible.com/u/G24Joshi1)\
**Post date:** [June 11, 2024, 10:16am UTC](https://forum.ansible.com/t/unable-to-copy-any-file-from-ansible-to-juniper-switch/6298/1 "2024-06-11T10:16:39Z")

</div>

Hi,

I am trying to copy a file from my ansible server to Juniper Switch via below playbook. but getting below error.

Could you please tell me the right module if any to copy or any another way to resolve this issue.

Error: cfatal: [10.160.110.193]: FAILED! =\> {“changed”: false, “destination”: “/var/tmp/testing99.txt”, “msg”: “Exception received: ‘str’ object is not callable”}

Playbook is:  
[root@lonsca01 juniperymls]# cat 1copy-ansible-to-switch.yml

- hosts: junipernew  
gather\_facts: no

* * *

---

<div class="post-metadata">

**Author:** ![motorbass](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@motorbass](https://forum.ansible.com/u/motorbass)\
**Post date:** [June 11, 2024, 11:46am UTC](https://forum.ansible.com/t/unable-to-copy-any-file-from-ansible-to-juniper-switch/6298/2 "2024-06-11T11:46:16Z")

</div>

You should better use the dedicated [junipernetworks.junos collection](https://docs.ansible.com/ansible/latest/collections/junipernetworks/junos/junos_scp_module.html#ansible-collections-junipernetworks-junos-junos-scp-module)  
using the scp\_module to transfer file.
