# Properly wait for apache to run before inserting into load balancer

**URL:** <https://forum.ansible.com/t/properly-wait-for-apache-to-run-before-inserting-into-load-balancer/17667>\
**Category:** Ansible Project\
**Created:** [March 4, 2015, 8:11pm UTC](https://forum.ansible.com/t/properly-wait-for-apache-to-run-before-inserting-into-load-balancer/17667 "2015-03-04T20:11:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_S](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sam\_S](https://forum.ansible.com/u/Sam_S)\
**Post date:** [March 4, 2015, 8:11pm UTC](https://forum.ansible.com/t/properly-wait-for-apache-to-run-before-inserting-into-load-balancer/17667/1 "2015-03-04T20:11:17Z")

</div>

In my post task I insert the web servers back into the pool.

What’s a good way to make sure Apache is running prior to running the post task section?

post\_tasks:

- name: enable in the lb  
netscaler: nsc\_host={{nsc\_host}} user={{nsc\_user}} password={{nsc\_pass}} name={{name}} type={{type}} action=enable validate\_certs=no  
delegate\_to: 127.0.0.1

---

<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:** [March 4, 2015, 8:18pm UTC](https://forum.ansible.com/t/properly-wait-for-apache-to-run-before-inserting-into-load-balancer/17667/2 "2015-03-04T20:18:56Z")

</div>

​perhaps doing the uri module in a loop, until some standard healthcheck  
page is returned​

---

<div class="post-metadata">

**Author:** ![Sam\_S](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sam\_S](https://forum.ansible.com/u/Sam_S)\
**Post date:** [March 4, 2015, 8:29pm UTC](https://forum.ansible.com/t/properly-wait-for-apache-to-run-before-inserting-into-load-balancer/17667/3 "2015-03-04T20:29:56Z")

</div>

I’m an idiot, I didn’t realize I could have multiple tasks in a post\_task. 😃

I added a new task to check for the webs and it works.
