Below is full log, You can see the NETCONF connection setup without issue. 
When scp grab the connection, it fails on the error message.


TASK [Gathering Facts] 
*********************************************************************************************************************************************************************************
task path: /home/copy_files.yml:2
<10.10.10.36> attempting to start connection
<10.10.10.36> using connection plugin netconf
<10.10.10.36> local domain socket does not exist, starting it
<10.10.10.36> control socket path is /home/testeuser/.ansible/pc/aaf9c3650d
<10.10.10.36> ESTABLISH NETCONF SSH CONNECTION FOR USER:
<10.10.10.36> connection to remote device started successfully
<10.10.10.36> local domain socket listeners started successfully
<10.10.10.36> 
<10.10.10.36> local domain socket path is 
/home/testuser/.ansible/pc/aaf9c3650d
<10.10.10.36> ESTABLISH LOCAL CONNECTION FOR USER: testuser
<10.10.10.36> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo 
/home/testuser/.ansible/tmp/ansible-local-2494gCtLcb/ansible-tmp-1558371312.67-88287809252004
 
`" && echo ansible-tmp-1558371312.67-88287809252004="` echo 
/home/testuser/.ansible/tmp/ansible-local-2494gCtLcb/ansible-tmp-1558371312.67-88287809252004
 
`" ) && sleep 0'
Using module file 
/usr/lib/python2.7/site-packages/ansible/modules/system/setup.py
<10.10.10.36> PUT 
/home/testuser/.ansible/tmp/ansible-local-2494gCtLcb/tmp8nNSb3 TO 
/home/testuser/.ansible/tmp/ansible-local-2494gCtLcb/ansible-tmp-1558371312.67-88287809252004/AnsiballZ_setup.py
<10.10.10.36> EXEC /bin/sh -c 'chmod u+x 
/home/testuser/.ansible/tmp/ansible-local-2494gCtLcb/ansible-tmp-1558371312.67-88287809252004/
 
/home/testuser/.ansible/tmp/ansible-local-2494gCtLcb/ansible-tmp-1558371312.67-88287809252004/AnsiballZ_setup.py
 
&& sleep 0'
<10.10.10.36> EXEC /bin/sh -c '/usr/bin/python 
/home/testuser/.ansible/tmp/ansible-local-2494gCtLcb/ansible-tmp-1558371312.67-88287809252004/AnsiballZ_setup.py
 
&& sleep 0'
<10.10.10.36> EXEC /bin/sh -c 'rm -f -r 
/home/testuser/.ansible/tmp/ansible-local-2494gCtLcb/ansible-tmp-1558371312.67-88287809252004/
 
> /dev/null 2>&1 && sleep 0'
ok: [tl1-mx5cb-1b]
META: ran handlers


TASK [copy file to junos devices] 
***********************************************************************************************************************************************************************
task path: /Playbooks/copy_files.yml:30
<10.10.10.36> attempting to start connection
<10.10.10.36> using connection plugin netconf
<10.10.10.36> found existing local domain socket, using it!
<10.10.10.36> 
<10.10.10.36> local domain socket path is /root/.ansible/pc/4fbb7f6db4
<10.10.10.36> ESTABLISH LOCAL CONNECTION FOR USER: root
<10.10.10.36> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo 
/root/.ansible/tmp/ansible-local-155389cSHV/ansible-tmp-1558370352.02-207708502585664
 
`" && echo ansible-tmp-1558370352.02-207708502585664="` echo 
/root/.ansible/tmp/ansible-local-155389cSHV/ansible-tmp-1558370352.02-207708502585664
 
`" ) && sleep 0'
Using module file 
/usr/lib/python2.7/site-packages/ansible/modules/network/junos/junos_scp.py
<10.10.10.36> PUT /root/.ansible/tmp/ansible-local-155389cSHV/tmpYXcWMa TO 
/root/.ansible/tmp/ansible-local-155389cSHV/ansible-tmp-1558370352.02-207708502585664/AnsiballZ_junos_scp.py
<10.10.10.36> EXEC /bin/sh -c 'chmod u+x 
/root/.ansible/tmp/ansible-local-155389cSHV/ansible-tmp-1558370352.02-207708502585664/
 
/root/.ansible/tmp/ansible-local-155389cSHV/ansible-tmp-1558370352.02-207708502585664/AnsiballZ_junos_scp.py
 
&& sleep 0'
<10.10.10.36> EXEC /bin/sh -c '/usr/bin/python 
/root/.ansible/tmp/ansible-local-155389cSHV/ansible-tmp-1558370352.02-207708502585664/AnsiballZ_junos_scp.py
 
&& sleep 0'
<10.10.10.36> EXEC /bin/sh -c 'rm -f -r 
/root/.ansible/tmp/ansible-local-155389cSHV/ansible-tmp-1558370352.02-207708502585664/
 
> /dev/null 2>&1 && sleep 0'
The full traceback is:
WARNING: The below traceback may *not* be related to the actual failure.
  File "/tmp/ansible_junos_scp_payload_flGRrz/__main__.py", line 165, in 
main
    device = connect(module)
  File "/tmp/ansible_junos_scp_payload_flGRrz/__main__.py", line 114, in 
connect
    device = Device(host, **kwargs)
  File "/usr/lib/python2.7/site-packages/jnpr/junos/device.py", line 1152, 
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"
}



On Monday, May 20, 2019 at 9:02:56 AM UTC-7, Yan Sun 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/1a2e13af-94f1-4ca5-a3b0-c2a9dbd30d5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to