-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
elb-target - Block/wait fails when target_status is healthy #44149
Comments
Files identified in the description: If these files are inaccurate, please update the |
Hi @nsushain, Thank you for the issue, just so you are aware we have a dedicated Working Group for aws. |
Hi folks, Thanks for reporting this issue. I wanted to chime in with some of my findings as I encountered this same problem. As I encountered it, not only does the module not always wait for the given state as intended, but it can also fail to register a target in a target group as well. I think that both of these issues have the same root cause. Looking at the register_target function in the implementation, this conditional will short-circuit registration as well as the logic for awaiting a healthy state: https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/amazon/elb_target.py#L187 These two conditionals are only both true if the target is not registered with the target group. On the surface, this seems like the correct logic, especially since we only want changed to be set to true when an actual change has occurred. However, this logic does not account for an extra bit of stateful behavior on the part of the load balancer/target group. Namely, the "draining" state. When a target is deregistered from a target group, it first enters a "draining" state for a period of time. During this time, it will not be given new requests but it will attempt to fulfill existing ones. The time spent in the draining state is configurable on the target group attributes. Once this time is over, the target will leave the target group and will then be "deregistered". Essentially, I suspect that this module needs to account for this "draining" state and still reregister the target when it is found to be in this state. If my observation is correct, I would expect a workaround to be that registering a target will only work reliably if it comes after a deregistration triggered by this module, in which the target_status is used to await an 'unused' state. However, I'm too cautious to rely on this for my needs and have chosen to fallback to using awscli commands for now. Hopefully the above will help diagnose and solve this issue or provide some guidance for others stumbling on this problem. |
Thank you very much for your interest in Ansible. Ansible has migrated much of the content into separate repositories to allow for more rapid, independent development. We are closing this issue/PR because this content has been moved to one or more collection repositories.
For further information, please see: |
SUMMARY
target_status does not block wait for given value for module elb_target
ISSUE TYPE
COMPONENT NAME
elb_target.py
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
Block wait till target_status is healthy, fail if it does not find target_status as healthy beyond 60 seconds
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: