Log in to ask questions, share your expertise, or stay connected to content you value. Don’t have a login? Learn how to become a member.
I am trying to use Ansible to SCP a file to Juniper devices. I had this working with a prior version of Ansible, but I received a new laptop that must have a newer version of Ansible and python and now the playbook fails, saying: "Connection type 'local' is not valid for 'junos_scp' module." I tried looking up the requirements for the junos_scp module, but it appears to be deprecated. What is the correct method to SCP file via Ansible? Does someone have a working example? Thanks.
Take a look at https://docs.ansible.com/ansible/latest/collections/ansible/netcommon/net_put_module.html
This looks promising, but I am having issues. Do you have this working with a Juniper switch? Using paramiko, I get "replay attack on SSH warnings" and partial transfer. I then loaded the optional ansible-pylibssh, and now I get "unable to connect to socket". Thanks for your assistance.
I was able to get this to work using paramiko (ansible_network_cli_ssh_type: paramiko), and increasing my command timeout (ansible_command_timeout: 600).
Thanks again for you suggestion!