mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Add aws_s3 action plugin to find source files as expected (#35028)
People expect to be able to upload files to s3 using standard locations for files. Providing an action plugin that effectively rewrites the `src` key to the result of finding such a file is a great help. Tests added, and IAM permissions corrected
This commit is contained in:
parent
d0e6889f93
commit
4d58d16793
4 changed files with 83 additions and 2 deletions
|
@ -65,6 +65,31 @@
|
|||
- result.changed == True
|
||||
- result.msg == "PUT operation complete"
|
||||
# ============================================================
|
||||
- name: check that roles file lookups work as expected
|
||||
aws_s3:
|
||||
bucket: "{{ bucket_name }}"
|
||||
mode: put
|
||||
src: hello.txt
|
||||
object: hello.txt
|
||||
<<: *aws_connection_info
|
||||
retries: 3
|
||||
delay: 3
|
||||
register: result
|
||||
- name: assert object exists
|
||||
assert:
|
||||
that:
|
||||
- result.changed == True
|
||||
- result.msg == "PUT operation complete"
|
||||
- name: remove hello.txt (deletion tests are later)
|
||||
aws_s3:
|
||||
bucket: "{{ bucket_name }}"
|
||||
mode: delobj
|
||||
object: hello.txt
|
||||
<<: *aws_connection_info
|
||||
retries: 3
|
||||
delay: 3
|
||||
register: result
|
||||
# ============================================================
|
||||
- name: create a second temp file to download the object from the bucket
|
||||
tempfile:
|
||||
register: tmp2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue