skip to Main Content

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

2

Answers


  1. Chosen as BEST ANSWER

    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


  2. Checkout syncronize module at Ansible Documentation: https://docs.ansible.com/ansible/latest/collections/ansible/posix/synchronize_module.html

    Also, be aware to stablish direct ssh connection between targets.

    Hint: It’s possible to activate ssh on windows and stablish connection to the linux machine. Take care of the risks!

    Other way is to use fetch and copy to do the triangle copy using Ansible server as elbow.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search