-
Notifications
You must be signed in to change notification settings - Fork 39
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
hcloud_load_balancer_info don't return status #467
Comments
Hi, There is a
See https://docs.hetzner.cloud/#load-balancers-get-a-load-balancer |
This is because the target is of type |
Thanks a i realized this a few minutes before and delete my comment ;-) |
Ok so there is no way to verify the overall Health of a loadbalencer with label_selector targets? |
I just tested this myself, and the "resolved" targets from the The API response looks like the following: {
"targets": [
{
"type": "label_selector",
"use_private_ip": false,
"label_selector": {
"selector": "test=ok"
},
"targets": [
{
"type": "server",
"server": {
"id": 43962499
},
"health_status": [
{
"listen_port": 80,
"status": "unhealthy"
}
],
"use_private_ip": false
}
]
}
]
} |
This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs. |
not stale |
@EHEX-schildt Since I prefer not to derive from what the API is returning by adding a returned field, I implemented a filter that computes the status of a load balancer. I implemented this filter in #550, let me know if this solves your problem. |
You should be able to wait for the load balance to be healthy, using: - name: Wait load balancer to become healthy
hetzner.hcloud.load_balancer_info:
name: my-load-balancer
register: result
until: result.hcloud_load_balancer_info[0] | hetzner.hcloud.load_balancer_status == "healthy"
retries: 5 |
SUMMARY
I would like to get the HEALTH STATUS of a loadbalencer to ensure that everything is fine before i continue my ansible run.
ISSUE TYPE
COMPONENT NAME
hetzner.hcloud.load_balancer_info
ANSIBLE VERSION
COLLECTION VERSION
STEPS TO REPRODUCE
EXPECTED RESULTS
some sort of status like "running" in output.hcloud_load_balancer_info
https://docs.ansible.com/ansible/latest/collections/hetzner/hcloud/load_balancer_info_module.html#return-hcloud_load_balancer_info/status
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: