Closed bencehornak-gls closed 1 year ago
@bencehornak-gls
Thanks for taking the time to open this issue. You're currently using release 5.0.0, we released 5.2.0 last week with a number of bugfixes, please could you try again with 5.2.0
Unfortunately the issue persists after upgrading to 5.2.0
Forgot to mention, but my workaround was to use content: '\n'
. It is fine for my use case, because extra new-lines are ignored in this file, but might not be an option for some use-cases.
That's helpful information. It looks like this is basically curl doing something weird: https://github.com/curl/curl/issues/183 I'm not sure what the appropriate fix would be :/
Yes, this seems to be the consequence of curl's crappy design here. I would also expect curl to create an empty file in this case.
For the time-being I don't see any other ways than adding a touch command after the curl command to make sure that it exists (even if it is supposed to be empty).
If you're willing to open a Pull Request we can probably get this patched and fixed pretty quickly:
https://github.com/ansible-collections/community.aws/blob/main/plugins/connection/aws_ssm.py#L832 with an extra test in https://github.com/ansible-collections/community.aws/blob/main/tests/integration/targets/connection/test_connection.yml
Summary
When I execute the builtin copy module with the
content
parameter set to empty string, I get the following error (taken from the-vvvv
logs):Issue Type
Bug Report
Component Name
ssm_plugin
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
Windows 10 with WSL (Ubuntu 20)
Steps to Reproduce
Use the built-in
copy
module with thecontent
set to empty string.Expected Results
The temporary
source
file should be an empty file (e.g./tmp/.ansible-/ansible-tmp-1675251475.8058956-7383-181169058616495/source
)Actual Results
The temporary
source
file is not present, so the Ansible step crashes.Output (sensitive parts are masked):
Note: if you repeat the steps with a host with SSH connection, the step just completes without error.
Code of Conduct