I’m writing very simple task - I have a web app that I start and it takes a few minutes before it goes online. I thought it can be done like this:
name: Waiting for the new environment to be online
uri: url=http://SOME_URL/api/heartbeat timeout=900
async: 900
poll: 10
But the problem is: SOME_URL is not resolvable instantly, it’s a new DNS record. So task fails with the error “msg: Unable to resolve the host name given.”.
Is there any way to solve this issue?
It fits this situation perfectly because wait_for will keep trying to
resolve the DNS name over and over (and not just once when it starts).
Regarding the application itself being up, let me suggest a subsequent
check with get_url module (this one doesn't keep trying to resolve the
hostname many times, so wait_for is really required).