# Cannot copy a file from S3 to a windows node. WinRM send\_input failed error.

**URL:** <https://forum.ansible.com/t/cannot-copy-a-file-from-s3-to-a-windows-node-winrm-send-input-failed-error/29111>\
**Category:** Ansible Project\
**Tags:** windows, aws\
**Created:** [November 25, 2018, 5:17am UTC](https://forum.ansible.com/t/cannot-copy-a-file-from-s3-to-a-windows-node-winrm-send-input-failed-error/29111 "2018-11-25T05:17:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yyellapragada](https://avatars.discourse-cdn.com/v4/letter/y/ed8c4c/32.png) [@yyellapragada](https://forum.ansible.com/u/yyellapragada)\
**Post date:** [November 25, 2018, 5:17am UTC](https://forum.ansible.com/t/cannot-copy-a-file-from-s3-to-a-windows-node-winrm-send-input-failed-error/29111/1 "2018-11-25T05:17:50Z")

</div>

Hello Team,

I just started using Ansible and am having trouble in getting it to work with AWS S3. Could you please have a look at the output and help me understand what I did wrong?

I did a lot of research on the error but am failing to get a complete picture of the problem.

To lay the context: I have an ec2 2008R2 instance in a private subnet which uses a NAT gateway to download stuff. I have created the Ansible Control Machine in a different account and am able to ping and get system report of the windows instances through VPC Peering.

Any help would be greatly appreciated. Thank you 🙂

Best,  
Yash.

`

PLAY [testing config management] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [x.x.x.x]

TASK [Simple GET operation] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [x.x.x.x]: FAILED! =\> {“msg”: "winrm send\_input failed; \nstdout: Unable to initialize device PRN\r\nUnable to initialize device PRN\r\nUnable to initialize device PRN\r\nUnable to initialize device PRN\r\nUnable to initialize device PRN\r\n\nstderr \_ANSIBALLZ\_WRAPPER : The term ‘\_ANSIBALLZ\_WRAPPER’ is not recognized as the \r\nname of a cmdlet, function, script file, or operable program. Check the \r\nspelling of the name, or if a path was included, verify that the path is \r\ncorrect and try again.\r\nAt line:1 char:1\r\n+ \_ANSIBALLZ\_WRAPPER = True # For test-module script to tell this is a \r\nANSIBALLZ\_W …\r\n+ ~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : ObjectNotFound: (\_ANSIBALLZ\_WRAPPER:String) , \r\n CommandNotFoundException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n \r\nAt line:1 char:21\r\n+ def \_ansiballz\_main():\r\n+ ~\r\nAn expression was expected after ‘(’.\r\n + CategoryInfo : ParserError: (🙂 , ParentContainsErrorRecordEx \r\n ception\r\n + FullyQualifiedErrorId : ExpectedExpression\r\n \r\nimport : The term ‘import’ is not recognized as the name of a cmdlet, \r\nfunction, script file, or operable program. Check the spelling of the name, or \r\nif a path was included, verify that the path is correct and try again.\r\nAt line:1 char:5\r\n+ import os\r\n+~~~~~~\r\n + CategoryInfo : ObjectNotFound: (import:String) , CommandNotFo \r\n undException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n \r\nimport : The term ‘import’ is not recognized as the name of a cmdlet, \r\nfunction, script file, or operable program. Check the spelling of the name, or \r\nif a path was included, verify that the path is correct and try again.\r\nAt line:1 char:5\r\n+ import os.path\r\n+ ~~~~~~\r\n + CategoryInfo : ObjectNotFound: (import:String) , CommandNotFo \r\n undException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n \r\nimport : The term ‘import’ is not recognized as the name of a cmdlet, \r\nfunction, script file, or operable program. Check the spelling of the name, or \r\nif a path was included, verify that the path is correct and try again.\r\nAt line:1 char:5\r\n+ import sys\r\n+~~~~~~\r\n + CategoryInfo : ObjectNotFound: (import:String) , CommandNotFo \r\n undException\r\n + FullyQualifiedErrorId :

`

This is the yml file.

`

- name: testing config management  
hosts: zags  
tasks:
- name: Simple GET operation  
aws\_s3:  
aws\_access\_key: “{{ lookup(‘env’,‘aws\_key’) }}”  
aws\_secret\_key: “{{ lookup(‘env’,‘aws\_secret’) }}”  
bucket: “ansibletestbucket”  
object: “IPS.txt”  
dest: “D:\IPS.txt”  
mode: get

`

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [November 25, 2018, 10:14am UTC](https://forum.ansible.com/t/cannot-copy-a-file-from-s3-to-a-windows-node-winrm-send-input-failed-error/29111/2 "2018-11-25T10:14:16Z")

</div>

You can’t run non PowerShell modules on a Windows host. You would have to set delegate\_to: localhost on the task to download it to the Ansible controller then use win\_copy to copy it across.

Thanks

Jordan

---

<div class="post-metadata">

**Author:** ![yyellapragada](https://avatars.discourse-cdn.com/v4/letter/y/ed8c4c/32.png) [@yyellapragada](https://forum.ansible.com/u/yyellapragada)\
**Post date:** [November 26, 2018, 11:56pm UTC](https://forum.ansible.com/t/cannot-copy-a-file-from-s3-to-a-windows-node-winrm-send-input-failed-error/29111/3 "2018-11-26T23:56:45Z")

</div>

Thanks Jordan. This worked. 🙂
