diff --git a/changelogs/fragments/825-fix-elb-wait.yml b/changelogs/fragments/825-fix-elb-wait.yml new file mode 100644 index 00000000000..afc87a06c56 --- /dev/null +++ b/changelogs/fragments/825-fix-elb-wait.yml @@ -0,0 +1,2 @@ +minor_changes: + - elb_instance - `wait` parameter is no longer ignored (https://github.com/ansible-collections/community.aws/pull/826) diff --git a/plugins/modules/elb_instance.py b/plugins/modules/elb_instance.py index 6116207866b..51ec03d5702 100644 --- a/plugins/modules/elb_instance.py +++ b/plugins/modules/elb_instance.py @@ -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 @@ -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):