# Ansible health check module for HTTP servers

**URL:** <https://forum.ansible.com/t/ansible-health-check-module-for-http-servers/15261>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [May 17, 2014, 6:16pm UTC](https://forum.ansible.com/t/ansible-health-check-module-for-http-servers/15261 "2014-05-17T18:16:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nadav\_Sr\_Samet](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Nadav\_Sr\_Samet](https://forum.ansible.com/u/Nadav_Sr_Samet)\
**Post date:** [May 17, 2014, 6:16pm UTC](https://forum.ansible.com/t/ansible-health-check-module-for-http-servers/15261/1 "2014-05-17T18:16:45Z")

</div>

Hi,

I’ve put together an Ansible module that performs health check on HTTP servers: [https://github.com/trueaccord/ansible-health-check](https://github.com/trueaccord/ansible-health-check)

We use it in production as part of our continuous deployment process: each time we push a new release our playbook deregisters one server at a time from AWS’s Elastic Load Balance, perform the upgrade, runs a couple of healthchecks on a few internal URLs, and once everything looks good it registers the instance again in ELB.

Hope this is helpful. If there is interest, I’ll be happy to work on getting it into core.

-Nadav

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [May 18, 2014, 8:35am UTC](https://forum.ansible.com/t/ansible-health-check-module-for-http-servers/15261/2 "2014-05-18T08:35:28Z")

</div>

Looks nice and clean.

In theory one could do the same with the uri module + until  
by AFAIK that doesn’t work out in combination with with\_items loops and register, which I needed.

Will have a try at it next week.

Serge

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 19, 2014, 3:00am UTC](https://forum.ansible.com/t/ansible-health-check-module-for-http-servers/15261/3 "2014-05-19T03:00:38Z")

</div>

“In theory one could do the same with the uri module + until”

This.

I’m not understanding why this module needed to exist, really, if it were not for not knowing about the until construct.

Help me understand?

---

<div class="post-metadata">

**Author:** ![Nadav\_Samet](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@Nadav\_Samet](https://forum.ansible.com/u/Nadav_Samet)\
**Post date:** [May 19, 2014, 4:14am UTC](https://forum.ansible.com/t/ansible-health-check-module-for-http-servers/15261/4 "2014-05-19T04:14:48Z")

</div>

Guilty as charged - I somehow missed ‘until’… Hopefully this is still useful for cases like Serge described. In our case where we want to expect a specific string in the response, I find it a little more elegant than using register and find.
