Skip to content

Ansible Module: nokia.nsp.download

Download files from Nokia NSP

Notes

Requires ansible.netcommon.httpapi connection using Network OS nokia.nsp.nsp.

Synopsis

  • Downloads binary or text files from Nokia NSP.
  • Supports NSP file-service application and custom endpoints.
  • Streams downloads to reduce memory usage for large files.
  • Calculates MD5 checksum of downloaded files for verification.
  • Handles both single and multiple file downloads.

Parameters

Parameter Type Comments
url str Full URL of the resource to download.
Path may include query parameters.
Mutually exclusive with remote_path.
remote_path list Remote file path(s) on NSP file-service application
Can be a string for single file or list for batch downloads.
Mutually exclusive with url.
local_path path Local path where file will be saved.
If this is a directory, filename from remote path is used.
Parent directories are created automatically.
Required: always

Examples

- name: Download using file-service path
  nokia.nsp.download:
    remote_path: /nokia/nsp/cam/artifacts/bundle/my-bundle.zip
    local_path: /tmp

- name: Download using full URL
  nokia.nsp.download:
    url: /nsp-file-service-app/rest/api/v1/file/downloadFile?filePath=/nokia/nsp/cam/artifacts/bundle/my-bundle.zip
    local_path: /tmp/my-bundle.zip

- name: Download multiple files
  nokia.nsp.download:
    remote_path:
      - /nokia/test_upload_A.txt
      - /nokia/test_upload_B.txt
    local_path: /tmp/download/

Return Values

Parameter Type Comments
remote_path str Remote file path or URL downloaded
Returned: always
Sample: "/nokia/nsp/cam/artifacts/bundle/file.zip"
local_path str Local destination file path
Returned: always
Sample: "/tmp/file.zip"
file_size int Downloaded file size in bytes
Returned: always
Sample: 1048576
checksum str MD5 checksum of downloaded file
Returned: always
Sample: "d41d8cd98f00b204e9800998ecf8427e"
results list List of per-file results when remote_path is a list
Returned: when remote_path is a list
Sample: []

New in version "0.1.0"