Hi,
I want to make a simple check after deploying an application with Ansible.
The task looks like this:
- name: Wait for application to listen
wait_for: host=localhost port={{ application_port }} state=started
timeout=30
tags:
- check
I expect an HTTP server to listen on that port, and t check it myself I
would use something like curl.
When I run it from my local machine, it works fine, but when it's run on
the CI server, this last step breaks after the timeout.
I have also seen this thing wrapped in the "local_action" module, but since
the above example works, I do not think that's the issue.
The only difference between CI run and me doing it locally is the
remote_user, but I find it hard to image how that can possibly have
anything to do with it., when only running the check.
There are probably many ways to solve the problem "Have Ansible exit with
an error, if the deployment fails", though this one is probably the
easiest, so any hint is appreciated.
The error I am getting:
failed: [162.13.11.115] => {"elapsed": 34, "failed": true}msg: Timeout when
waiting for localhost:8000
However, as stated before ssh'ing onto the machine and executing "curl
localhost:8000" works just fine.
Regards,
Thomas
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/6466751d-7700-4f03-acfe-48e8fd44a3df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.