Search code examples
linuxwindowsansiblefile-transfer

How ansible copy file from remote windows to remote linux without local copy and ssh install in windows


OS: Wk16 vs Debian 10.4 Ansible: 2.9

Hi all

I need to send a file from remote Windows to remote linux without to copy in local without to install ssh package in Windows server.

A Win_server <-- Ansible role executor -- B Ansible_host         C linux_host
|
|                                                                   ^
|___SENDING FILE_______________________________________TO___________|

Thank's a lot


Solution

  • Today I putted the SSH in Windows how @guistela sayed.

    I Installed "Posh-SSH" on Windows host with ansible:

    1. Manual Download from: https://www.powershellgallery.com/packages/Posh-SSH.
    2. Send file to Windows host contains files to send.
    3. Install with microsoft steps: Installing PowerShell modules from a NuGet package.
    4. Possh-SSH use commands, more info here: powershell-scp-to-transfer-files-between-windows-linux:
    • Open ports
    • Send file
    • Close ports

    This 4 general steps permits send files from windows to linux hosts.

    Cordially