-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
205 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ encryption_sse | |
public_access | ||
acl | ||
object_lock | ||
accelerate | ||
|
||
[all:vars] | ||
ansible_connection=local | ||
|
145 changes: 145 additions & 0 deletions
145
tests/integration/targets/s3_bucket/roles/s3_bucket/tasks/accelerate.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
--- | ||
- module_defaults: | ||
group/aws: | ||
access_key: "{{ aws_access_key }}" | ||
secret_key: "{{ aws_secret_key }}" | ||
session_token: "{{ security_token | default(omit) }}" | ||
region: "{{ aws_region }}" | ||
block: | ||
- ansible.builtin.set_fact: | ||
local_bucket_name: "{{ bucket_name | hash('md5')}}-accelerate" | ||
|
||
# ============================================================ | ||
|
||
- name: Create a simple bucket | ||
amazon.aws.s3_bucket: | ||
name: "{{ local_bucket_name }}" | ||
state: present | ||
register: output | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- output.changed | ||
- not output.accelerate_enabled | ||
|
||
- name: Re-disable transfer acceleration (idempotency) | ||
amazon.aws.s3_bucket: | ||
name: "{{ local_bucket_name }}" | ||
state: present | ||
accelerate_enabled: false | ||
register: output | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- not output.changed | ||
- not output.accelerate_enabled | ||
|
||
- name: Enable transfer acceleration | ||
amazon.aws.s3_bucket: | ||
name: "{{ local_bucket_name }}" | ||
state: present | ||
accelerate_enabled: true | ||
register: output | ||
ignore_errors: false | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- output.changed | ||
- output.accelerate_enabled | ||
|
||
- name: Re-Enable transfer acceleration (idempotency) | ||
amazon.aws.s3_bucket: | ||
name: "{{ local_bucket_name }}" | ||
state: present | ||
accelerate_enabled: true | ||
register: output | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- not output.changed | ||
- output.accelerate_enabled | ||
|
||
- name: Delete test s3 bucket | ||
amazon.aws.s3_bucket: | ||
name: "{{ local_bucket_name }}" | ||
state: absent | ||
register: output | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- output.changed | ||
|
||
# ============================================================ | ||
|
||
- name: Create a bucket with transfer accelerate enabled | ||
amazon.aws.s3_bucket: | ||
name: "{{ local_bucket_name }}-2" | ||
state: present | ||
accelerate_enabled: true | ||
register: output | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- output.changed | ||
- output.accelerate_enabled | ||
|
||
- name: Disable transfer accelerate | ||
amazon.aws.s3_bucket: | ||
name: "{{ local_bucket_name }}-2" | ||
state: present | ||
accelerate_enabled: false | ||
register: output | ||
ignore_errors: false | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- output.changed | ||
- not output.accelerate_enabled | ||
|
||
- name: Re-Enable transfer accelerate (idempotency) | ||
amazon.aws.s3_bucket: | ||
name: "{{ local_bucket_name }}-2" | ||
state: present | ||
accelerate_enabled: true | ||
register: output | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- output.changed | ||
- output.accelerate_enabled | ||
|
||
- name: Touch bucket with transfer accelerate enabled (idempotency) | ||
amazon.aws.s3_bucket: | ||
name: "{{ local_bucket_name }}-2" | ||
state: present | ||
accelerate_enabled: true | ||
register: output | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- not output.changed | ||
- output.accelerate_enabled | ||
|
||
- name: Delete test s3 bucket | ||
amazon.aws.s3_bucket: | ||
name: "{{ local_bucket_name }}-2" | ||
state: absent | ||
register: output | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- output.changed | ||
|
||
# ============================================================ | ||
always: | ||
- name: Ensure all buckets are deleted | ||
amazon.aws.s3_bucket: | ||
name: "{{ local_bucket_name }}" | ||
state: absent | ||
ignore_errors: true | ||
|
||
- name: Ensure all buckets are deleted | ||
amazon.aws.s3_bucket: | ||
name: "{{ local_bucket_name }}-2" | ||
state: absent | ||
ignore_errors: true |