Open EHEX-schildt opened 4 months ago
Hi,
The returned status
from the documentation shouldn't exist, I will remove it from the docs. We could compute our own value for this status field, but I am not sure if this is ideal.
There is a health_status
object for the targets https://docs.ansible.com/ansible/latest/collections/hetzner/hcloud/load_balancer_info_module.html#return-hcloud_load_balancer_info/targets/health_status, you may use this value to check the status of your load balancer.
Note that:
See https://docs.hetzner.cloud/#load-balancers-get-a-load-balancer
in my example output there is also no "health_status object for the targets".
This is because the target is of type label_selector
, as stated above, the health status is only present on IP or server target types. You can find the documentation for the health status field here https://docs.hetzner.cloud/#load-balancers-get-a-load-balancer
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 label_selector
target, do have a health status. This is not clear in the documentation, I'll try to improve this, and I'll get back to you with a solution.
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
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