Unable to copy any file from ansible to Juniper switch

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

    vars:
    ansible_command_timeout: 65200
    ansible_connection: network_cli
    file1: testing99.txt

    tasks:

    • name: Copy ios image file to juniper switch
      ansible.netcommon.net_put:
      src: “/var/lib/tftpboot/{{ file1 }}”
      dest: “/var/tmp/testing99.txt”
      [root@lonsca01 juniperymls]#

You should better use the dedicated junipernetworks.junos collection
using the scp_module to transfer file.