-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a content parameter to aws_s3 put operation #20
Conversation
Comment from original PR:
|
Another comment:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for migrating this over. I've not tested this locally, but some some minor comments
I also noticed that there a ton of % formats in the module. |
I addressed your comments and also fixed a bug with etag calculation that popped up thanks to the idempotency test. My other two comments regarding |
Short verison on The only trouble with testing that dest exists is that you need to check that the parent folder exists since you may be creating the target. (but it would be worth tweaking that to type=path too) |
plugins/modules/aws_s3.py
Outdated
- This parameter will be treated as a string and converted to UTF-8 before sending it to S3. | ||
To send binary data, use the I(src) parameter instead. | ||
- Either I(content) or I(src) must be specified for a PUT operation. Ignored otherwise. | ||
version_added: "2.10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jillr What are we supposed to be using for 'version_added' at the minute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tremble the collection version the patch will land in, using semver. We should be targeting version_added: 1.1.0
right now.
Regarding python2, Ansible will support 2.7 as long as we have supported platforms that ship with 2.7 (like RHEL). So it would be good to update these but it's not urgent. |
@onitake following up on your question:
Unfortunately there's not any good ways to take multiple types of content in the same parameter. The best way to handle this would be to have a |
And the |
Thanks for the suggestions, I will add such a parameter. |
I implemented the mentioned |
Many thanks for your efforts on this. I'm sorry it's taken so long. Given how long you've been waiting on us for this I've added a changelog fragment and tweaked the 'added_in' value. |
Thanks for taking time to review this & merging it! |
SUMMARY
This is a port of the original pull request at ansible/ansible#67091 to collections. There might still be compatibility issues due to renamed packages.
Add support for uploading S3 objects from in-memory content in addition to on-disk files.
Fixes ansible/ansible#67086
ISSUE TYPE
COMPONENT NAME
aws_s3
ADDITIONAL INFORMATION
Example usage: