Closed johndevera closed 10 months ago
Thanks for taking the time to open this issue. Unfortunately I believe this is expected behaviour.
The AWS collections are Python based. As far as I can tell, Ansible doesn't support running Python modules on Windows hosts (Ansible uses PowerShell for the various Windows modules):
Can I run Python modules on Windows hosts?
No, the WinRM connection protocol is set to use PowerShell modules, so Python modules will not work. A way to bypass this issue to use delegate_to: localhost to run a Python module on the Ansible control node. This is useful if during a playbook, an external service needs to be contacted and there is no equivalent Windows module available.
The exception you've pasted only includes lines from the wrapper that Ansible uses to copy and then remotely execute modules, the s3_object code hasn't even been evaluated.
While some Ansible modules have PowerShell equivalents, this is mostly limited to the "core" modules. Given the level of effort that would be involved, I don't foresee PowerShell versions of the AWS modules being released any time soon.
Summary
I'm on my Mac calling ansible on a windows device. Other ansible moduleswork like normal, but when I get to calling the
amazon.aws.s3_object
, it failsI run:
Fails with the attached error
Issue Type
Bug Report
Component Name
amazon.aws.s3_object
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
Running Ansible on macOS Ventura 13.4.1, Apple M2 Pro Inside Python 3.11.6 virtualenvironment with modules python = ">=3.10, <3.12.0" ansible = "9.1.0" ansible-core = "2.16.2" awscli = "1.32.15" boto3 = "1.34.15" pywinrm = "0.4.3"
Steps to Reproduce
Expected Results
The file from S3 called
My_file.txt
should be placed inside the directory, specified by"{{ download_directory }}"
Actual Results
Code of Conduct