Skip to content
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

ec2_eni - Increase timeout when waiting for ENIs to detach #501

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/501-ec2_eni-timeout.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- ec2_eni - timeout increased when waiting for ENIs to finish detaching (https://github.com/ansible-collections/amazon.aws/pull/501).
7 changes: 5 additions & 2 deletions plugins/modules/ec2_eni.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,9 +684,12 @@ def detach_eni(connection, eni, module):
connection.detach_network_interface(
aws_retry=True,
AttachmentId=eni["Attachment"]["AttachmentId"],
Force=force_detach
Force=force_detach,
)
get_waiter(connection, 'network_interface_available').wait(
NetworkInterfaceIds=[eni_id],
WaiterConfig={'Delay': 5, 'MaxAttempts': 80},
)
get_waiter(connection, 'network_interface_available').wait(NetworkInterfaceIds=[eni_id])
return True

return False
Expand Down