cisco.radkit.put_file module – Uploads a file to a remote device using SCP or SFTP via RADKit

Note

This module is part of the cisco.radkit collection (version 2.0.0).

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 git+https://wwwin-github.cisco.com/scdozier/cisco.radkit-ansible.git. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: cisco.radkit.put_file.

New in cisco.radkit 1.7.5

Synopsis

  • Uploads a file to a remote device using SCP or SFTP via RADKit

Requirements

The below requirements are needed on the host that executes this module.

  • radkit

Parameters

Parameter

Comments

client_ca_path

string

Alternate path to client ca cert for RADKIT If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_CLIENT_CA_PATH will be used instead.

client_cert_path

string

Alternate path to client cert for RADKIT If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_CLIENT_CERT_PATH will be used instead.

client_key_password_b64

aliases: radkit_client_private_key_password_base64

string / required

Client certificate password in base64 If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_CLIENT_PRIVATE_KEY_PASSWORD_BASE64 will be used instead.

client_key_path

string

Alternate path to client key for RADKIT If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_CLIENT_KEY_PATH will be used instead.

device_host

string

Hostname or IP address of the device as it appears in the RADKit inventory. Use either device_name or device_host.

device_name

string

Name of device as it shows in RADKit inventory

identity

aliases: radkit_identity

string / required

Identity to authentiate with RADKit (xxxx@cisco.com). If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_IDENTITY will be used instead.

local_path

string / required

Path to the local file to be uploaded

protocol

string / required

Protocol to use for uploading, either scp or sftp

remote_path

string / required

Path on the remote device where the file will be uploaded

service_serial

aliases: radkit_serial, radkit_service_serial

string / required

Radkit service serial If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_SERVICE_SERIAL will be used instead.

Examples

- name: Upload file to device using SCP
  put_file:
    device_name: router1
    local_path: /path/to/local/file
    remote_path: /path/to/remote/file
    protocol: scp

- name: Upload file to device using SFTP
  put_file:
    device_name: router1
    local_path: /path/to/local/file
    remote_path: /path/to/remote/file
    protocol: sftp

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

message

string

Status message

Returned: always

Authors

  • Scott Dozier (@scdozier)