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

Respect wait parameter in elb_instance when adding/removing instances #826

Merged
Show file tree
Hide file tree
Changes from all 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/825-fix-elb-wait.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- elb_instance - `wait` parameter is no longer ignored (https://github.com/ansible-collections/community.aws/pull/826)
10 changes: 6 additions & 4 deletions plugins/modules/elb_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ def deregister(self, wait, timeout):
# already OutOfService is being deregistered.
self.changed = True

for lb in self.lbs:
self._await_elb_instance_state(lb, 'Deregistered', timeout)
if wait:
for lb in self.lbs:
self._await_elb_instance_state(lb, 'Deregistered', timeout)

def register(self, wait, enable_availability_zone, timeout):
"""Register the instance for all ELBs and wait for the ELB
Expand Down Expand Up @@ -176,8 +177,9 @@ def register(self, wait, enable_availability_zone, timeout):

self.changed = True

for lb in self.lbs:
self._await_elb_instance_state(lb, 'InService', timeout)
if wait:
for lb in self.lbs:
self._await_elb_instance_state(lb, 'InService', timeout)

@AWSRetry.jittered_backoff()
def _describe_elbs(self, **params):
Expand Down