junos_scp module relies on junos-eznc <https://pypi.org/project/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 <https://docs.ansible.com/ansible/latest/modules/net_put_module.html> and net_get <https://docs.ansible.com/ansible/latest/modules/net_get_module.html> modules in Ansible which should work with JUNOS device for file transfer and doesn't require provider argument. On Mon, May 20, 2019 at 12:03 PM Yan Sun <[email protected]> wrote: > 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. > > On Friday, May 17, 2019 at 8:08:22 PM UTC-7, Ganesh Nalawade wrote: >> >> 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 >> https://docs.ansible.com/ansible/latest/modules/junos_scp_module.html >> >> >> On Fri, May 17, 2019 at 4:38 PM Yan Sun <[email protected]> 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 [email protected]. >>> To post to this group, send email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/ansible-project/3688461b-1e36-422b-8e63-1324c4fa82bc%40googlegroups.com >>> <https://groups.google.com/d/msgid/ansible-project/3688461b-1e36-422b-8e63-1324c4fa82bc%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- > 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 [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/bebb7c88-546e-46fb-a830-1d209ab9777a%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/bebb7c88-546e-46fb-a830-1d209ab9777a%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Regards, Ganesh B. Nalawade Principal Engineer Ansible by Red Hat irc: ganeshrn -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2B6y2sEoQe6tvTUKw5W%3DSOwvHtmGP2hdMHwayP8-OW-A8MvNbw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
