Re: [ansible-project] junos_scp not working

37 views
Skip to first unread message
Message has been deleted

Ganesh Nalawade

unread,
May 17, 2019, 11:08:22 PM5/17/19
to ansible...@googlegroups.com
Based on the logs it seems you have not set the value of provider argument in the task.
junos_scp module requires the provider key to be set. More details refer the module documentation

On Fri, May 17, 2019 at 4:38 PM Yan Sun <yans...@gmail.com> wrote:
WARNING: The below traceback may *not* be related to the actual failure.
  File "/tmp/ansible_junos_scp_payload_jlnsCA/__main__.py", line 165, in main
    device = connect(module)
  File "/tmp/ansible_junos_scp_payload_jlnsCA/__main__.py", line 114, in connect
    device = Device(host, **kwargs)
  File "/usr/lib/python2.7/site-packages/jnpr/junos/device.py", line 1151, in __init__
    raise ValueError("You must provide either 'host' or 'sock_fd' value")

failed: [tl1-mx5cb-1b] (item=/home/tl1-mx5cb-1b.config.txt) => {
    "changed": false, 
    "invocation": {
        "module_args": {
            "dest": "/tmp/", 
            "host": null, 
            "password": null, 
            "port": null, 
            "provider": {}, 
            "recursive": false, 
            "remote_src": false, 
            "src": [
                "/home/tl1-mx5cb-1b.config.txt"
            ], 
            "ssh_keyfile": null, 
            "timeout": null, 
            "transport": null, 
            "username": null
        }
    }, 
    "item": "/home/tl1-mx5cb-1b.config.txt", 
    "msg": "You must provide either 'host' or 'sock_fd' value"

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3688461b-1e36-422b-8e63-1324c4fa82bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



Yan Sun

unread,
May 20, 2019, 12:02:56 PM5/20/19
to Ansible Project
Thanks!
The provider has be deprecated since Ansible 2.5. In my case, Ansible server has NETCONF connection setup with password, but, it fails on junos_scp. If I replace juno_scp with junos_command, there are no this kinds of issue at all.  
To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.
Message has been deleted

Ganesh Nalawade

unread,
May 20, 2019, 10:02:24 PM5/20/19
to ansible...@googlegroups.com
junos_scp module relies on junos-eznc library for file transfer to a JUNOS device, that's the reason provider argument is required. The provider deprecation warning for junos_scp module is not correct and needs to be fixed. Please raise an issue on Github to track it.

junos_command module uses Ansible netconf connection type hence provider is no longer required for the junos_command module.

Also FYI you can use net_put and net_get modules in Ansible which should work with JUNOS device for file transfer and doesn't require provider argument.


To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.

To post to this group, send email to ansible...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Regards,
Ganesh B. Nalawade
Principal Engineer
Ansible by Red Hat
irc: ganeshrn

Reply all
Reply to author
Forward
0 new messages