-
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
Re-enable ec2_vpc_endpoint tests #1167
Merged
softwarefactory-project-zuul
merged 1 commit into
ansible-collections:main
from
tremble:tests/integration/ec2_vpc_endpoint/re-enable
Oct 13, 2022
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
changelogs/fragments/20221013-reenable-ec2_vpc_endpoint-tests.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,2 @@ | ||
trivial: | ||
- ec2_vpc_endpoint - Re-enable ec2_vpc_endpoint tests |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
time=7m | ||
|
||
cloud/aws | ||
disabled | ||
|
||
ec2_vpc_endpoint_info |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
dependencies: [] | ||
dependencies: | ||
- role: setup_ec2_vpc |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
disabled |
Empty file.
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 @@ | ||
dependencies: [] |
126 changes: 126 additions & 0 deletions
126
tests/integration/targets/setup_ec2_vpc/tasks/cleanup.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,126 @@ | ||
# ============================================================ | ||
- name: Run all tests | ||
module_defaults: | ||
group/aws: | ||
aws_access_key: '{{ aws_access_key }}' | ||
aws_secret_key: '{{ aws_secret_key }}' | ||
security_token: '{{ security_token | default(omit)}}' | ||
region: '{{ aws_region }}' | ||
block: | ||
|
||
# ============================================================ | ||
# Describe state of remaining resources | ||
|
||
- name: '(VPC Cleanup) Find all remaining ENIs' | ||
ec2_eni_info: | ||
filters: | ||
vpc-id: '{{ vpc_id }}' | ||
register: remaining_enis | ||
|
||
- name: '(VPC Cleanup) Retrieve security group info based on VPC ID' | ||
ec2_group_info: | ||
filters: | ||
vpc-id: '{{ vpc_id }}' | ||
register: remaining_groups | ||
|
||
- name: '(VPC Cleanup) Retrieve subnet info based on VPC ID' | ||
ec2_vpc_subnet_info: | ||
filters: | ||
vpc-id: '{{ vpc_id }}' | ||
register: remaining_subnets | ||
|
||
- name: '(VPC Cleanup) Retrieve route table info based on VPC ID' | ||
ec2_vpc_route_table_info: | ||
filters: | ||
vpc-id: '{{ vpc_id }}' | ||
register: remaining_rtbs | ||
|
||
- name: '(VPC Cleanup) Retrieve VPC info based on VPC ID' | ||
ec2_vpc_net_info: | ||
vpc_ids: | ||
- '{{ vpc_id }}' | ||
register: remaining_vpc | ||
|
||
# ============================================================ | ||
|
||
- name: '(Cleanup) Delete all ENIs' | ||
ec2_eni: | ||
state: absent | ||
eni_id: '{{ item.id }}' | ||
register: eni_removed | ||
until: eni_removed is not failed | ||
loop: '{{ remaining_enis.network_interfaces }}' | ||
ignore_errors: yes | ||
retries: 10 | ||
|
||
# ============================================================ | ||
# Delete all remaining SGs | ||
|
||
# Cross-dependencies between rules in the SGs can cause us problems if we don't clear the rules | ||
# first | ||
- name: '(VPC Cleanup) Delete rules from remaining SGs' | ||
ec2_group: | ||
name: '{{ item.group_name }}' | ||
group_id: '{{ item.group_id }}' | ||
description: '{{ item.description }}' | ||
rules: [] | ||
rules_egress: [] | ||
loop: '{{ remaining_groups.security_groups }}' | ||
ignore_errors: yes | ||
|
||
- name: '(VPC Cleanup) Delete remaining SGs' | ||
ec2_group: | ||
state: absent | ||
group_id: '{{ item.group_id }}' | ||
loop: '{{ remaining_groups.security_groups }}' | ||
ignore_errors: yes | ||
|
||
# ============================================================ | ||
|
||
- name: '(VPC Cleanup) Delete remaining subnets' | ||
ec2_vpc_subnet: | ||
state: absent | ||
vpc_id: '{{ vpc_id }}' | ||
cidr: '{{ item.cidr_block }}' | ||
register: subnets_removed | ||
loop: '{{ remaining_subnets.subnets }}' | ||
until: subnets_removed is not failed | ||
when: | ||
- item.name != 'default' | ||
ignore_errors: yes | ||
retries: 10 | ||
|
||
# ============================================================ | ||
|
||
- name: '(VPC Cleanup) Delete IGW' | ||
ec2_vpc_igw: | ||
state: absent | ||
vpc_id: '{{ vpc_id }}' | ||
register: igw_deletion | ||
retries: 10 | ||
delay: 5 | ||
until: igw_deletion is success | ||
ignore_errors: yes | ||
|
||
# ============================================================ | ||
|
||
- name: '(VPC Cleanup) Delete remaining route tables' | ||
ec2_vpc_route_table: | ||
state: absent | ||
vpc_id: '{{ vpc_id }}' | ||
route_table_id: '{{ item.id }}' | ||
lookup: 'id' | ||
register: rtbs_removed | ||
loop: '{{ remaining_rtbs.route_tables }}' | ||
ignore_errors: yes | ||
|
||
# ============================================================ | ||
|
||
- name: '(VPC Cleanup) Remove the VPC' | ||
ec2_vpc_net: | ||
state: absent | ||
vpc_id: '{{ vpc_id }}' | ||
register: vpc_removed | ||
until: vpc_removed is not failed | ||
ignore_errors: yes | ||
retries: 10 |
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,2 @@ | ||
- debug: | ||
msg: 'VPC Cleanup module loaded' |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
"wait: true" is documented as only working for creation, not deletion :( This isn't a bug, but would be a nice feature. Out of scope for just getting the tests running.