# Rolling application deployments with Ngnix as LB

**URL:** <https://forum.ansible.com/t/rolling-application-deployments-with-ngnix-as-lb/12803>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [May 13, 2013, 6:35pm UTC](https://forum.ansible.com/t/rolling-application-deployments-with-ngnix-as-lb/12803 "2013-05-13T18:35:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [May 13, 2013, 6:35pm UTC](https://forum.ansible.com/t/rolling-application-deployments-with-ngnix-as-lb/12803/1 "2013-05-13T18:35:42Z")

</div>

I’m currently doing something very similar, just using lineinfile module to add/remove ‘down’ from current host in upstream entry.

---

<div class="post-metadata">

**Author:** ![Patrick\_Regan](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@Patrick\_Regan](https://forum.ansible.com/u/Patrick_Regan)\
**Post date:** [May 13, 2013, 6:42pm UTC](https://forum.ansible.com/t/rolling-application-deployments-with-ngnix-as-lb/12803/2 "2013-05-13T18:42:22Z")

</div>

I’ve been thinking of using a sort of upstream-enabled directory that contains .conf files for each server on the backend. Then you just add/remove conf files in that directory and reload to add/remove servers to the balancer. I haven’t done this or tested it yet though. I may produce some issues.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [May 13, 2013, 10:00pm UTC](https://forum.ansible.com/t/rolling-application-deployments-with-ngnix-as-lb/12803/3 "2013-05-13T22:00:09Z")

</div>

Another idea is that if you use the template module, you could use the ‘set\_fact’ module new in 1.2 to set the variable to the host to ‘down’ (assuming a default of ‘up’) and then the template could just walk over all hosts in the group.
