ncstate.network.sftp_send (1.1.3) — module

Send data directly to SFTP server from where ansible runs.

Authors: Matt Haught (@haught)

Install collection

Install with ansible-galaxy collection install ncstate.network:==1.1.3


Add to requirements.yml

  collections:
    - name: ncstate.network
      version: 1.1.3

Description

This module allows sending files and text using SFTP.

The module sends from wherever the playbook is run.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Send sftp file
  ncstate.network.sftp_send:
      host: 1.2.3.4
      username: foo
      password: bar
      src: "{{ string }}"
      dest_filename: '/dest/file.txt'

Inputs

    
src:
    description:
    - The text of the source file.
    required: true
    type: str

host:
    description:
    - The IP address or hostname of destination SFTP server.
    required: true
    type: str

port:
    default: 22
    description:
    - The port of destination SFTP server.
    required: false
    type: int

password:
    description:
    - The password for the connection.
    required: true
    type: str

username:
    description:
    - The username for the connection.
    required: true
    type: str

dest_filename:
    description:
    - The destination filename.
    required: true
    type: str

Outputs

stdout:
  description: The set of responses from the commands
  returned: always apart from low level errors (such as action plugin)
  sample:
  - '...'
  - '...'
  type: list
stdout_lines:
  description: The value of stdout split into a list
  returned: always
  sample:
  - - '...'
    - '...'
  - - '...'
  - - '...'
  type: list