-
Notifications
You must be signed in to change notification settings - Fork 343
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
8 changed files
with
750 additions
and
28 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
32 changes: 32 additions & 0 deletions
32
tests/integration/targets/elb_classic_lb/tasks/cleanup_s3.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,32 @@ | ||
--- | ||
- name: Create empty temporary directory | ||
tempfile: | ||
state: directory | ||
register: tmpdir | ||
ignore_errors: true | ||
|
||
- name: Empty S3 buckets before deletion | ||
s3_sync: | ||
bucket: '{{ item }}' | ||
delete: true | ||
file_root: '{{ tmpdir.path }}' | ||
ignore_errors: true | ||
loop: | ||
- '{{ s3_logging_bucket_a }}' | ||
- '{{ s3_logging_bucket_b }}' | ||
|
||
- name: Delete S3 bucket for access logs | ||
s3_bucket: | ||
name: '{{ item }}' | ||
state: absent | ||
register: logging_bucket | ||
ignore_errors: true | ||
loop: | ||
- '{{ s3_logging_bucket_a }}' | ||
- '{{ s3_logging_bucket_b }}' | ||
|
||
- name: Remove temporary directory | ||
file: | ||
state: absent | ||
path: "{{ tmpdir.path }}" | ||
ignore_errors: yes |
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
26 changes: 26 additions & 0 deletions
26
tests/integration/targets/elb_classic_lb/tasks/setup_s3.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,26 @@ | ||
--- | ||
- name: Create S3 bucket for access logs | ||
vars: | ||
s3_logging_bucket: '{{ s3_logging_bucket_a }}' | ||
s3_bucket: | ||
name: '{{ s3_logging_bucket_a }}' | ||
state: present | ||
policy: "{{ lookup('template','s3_policy.j2') }}" | ||
register: logging_bucket | ||
|
||
- assert: | ||
that: | ||
- logging_bucket is changed | ||
|
||
- name: Create S3 bucket for access logs | ||
vars: | ||
s3_logging_bucket: '{{ s3_logging_bucket_b }}' | ||
s3_bucket: | ||
name: '{{ s3_logging_bucket_b }}' | ||
state: present | ||
policy: "{{ lookup('template','s3_policy.j2') }}" | ||
register: logging_bucket | ||
|
||
- assert: | ||
that: | ||
- logging_bucket is changed |
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
Oops, something went wrong.