Note
This module is part of the junipernetworks.junos collection (version 9.1.0).
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install junipernetworks.junos. You need further requirements to be able to use this module, see Requirements for details.
To use it in a playbook, specify: junipernetworks.junos.junos_scp.
New in junipernetworks.junos 1.0.0
major release after 2025-01-01
Updated modules released with more functionality
Use ansible.netcommon.net_get, ansible.netcommon.net_put instead.
The below requirements are needed on the host that executes this module.
Parameter | Comments |
|---|---|
dest path | The Default: |
provider dictionary | Deprecated Starting with Ansible 2.5 we recommend using For more information please see the Junos OS Platform Options guide. A dict object containing connection details. |
|
host string |
Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
|
password string |
Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable |
|
port integer |
Specifies the port to use when building the connection to the remote device. The port value will default to the well known SSH port of 22 (for |
|
ssh_keyfile path |
Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable |
|
timeout integer |
Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
|
transport string |
Configures the transport connection to use when connecting to the remote device. Choices:
|
|
username string |
Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable |
recursive boolean | The Choices:
|
remote_src boolean | The Choices:
|
src list / elements=path / required | The |
ssh_config path | The |
ssh_private_key_file path | The |
Note
local connections only.ssh_config unlike other junos modules that uses netconf connection type.# the required set of connection arguments have been purposely left off
# the examples for brevity
- name: upload local file to home directory on remote device
junipernetworks.junos.junos_scp:
src: test.tgz
- name: upload local file to tmp directory on remote device
junipernetworks.junos.junos_scp:
src: test.tgz
dest: /tmp/
- name: download file from remote device
junipernetworks.junos.junos_scp:
src: test.tgz
remote_src: true
- name: ssh config file path for jumphost config
junipernetworks.junos.junos_scp:
src: test.tgz
remote_src: true
ssh_config: /home/user/customsshconfig
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
changed boolean | always true Returned: always |
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/junipernetworks/junos/junos_scp_module.html