Skip to content

wait_for_http

!wait_for_http

Category: control

Poll an HTTP endpoint until it responds (optionally with a specific status code), useful for waiting on an API or service to become ready after boot. Fails on timeout.

Parameters

NameTypeRequiredDescription
urlstringyesThe HTTP(S) URL to poll.
expectedintnoExpected HTTP status code (e.g. 200). If omitted, any 2xx is accepted.
timeoutintnoMaximum seconds to wait. Default 300.
delayintnoSeconds between polls. Default 5.
verify_tlsboolnoVerify the TLS certificate. Default false.

Examples

- !wait_for_http
  url: http://10.7.1.50:8080/health
  expected: 200
  timeout: 120