# Ansible forks, serial and all that just for one group?

**URL:** <https://forum.ansible.com/t/ansible-forks-serial-and-all-that-just-for-one-group/21837>\
**Category:** Ansible Project\
**Created:** [June 22, 2016, 7:00pm UTC](https://forum.ansible.com/t/ansible-forks-serial-and-all-that-just-for-one-group/21837 "2016-06-22T19:00:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [June 22, 2016, 7:00pm UTC](https://forum.ansible.com/t/ansible-forks-serial-and-all-that-just-for-one-group/21837/1 "2016-06-22T19:00:22Z")

</div>

Dear all,

I know that by setting "serial: 1" in a play I can make sure that only  
one host is being changed at a time. This overrides the forks setting.

But both settings are either global (forks) or per-play. I need  
something like this for a group of servers. I do not want to maintain  
a duplicate repository where all my playsbooks container "serial: 1"  
just for that group.

Is it possible to achieve something similar on a group\_var basis?

Thanks in advance.

Johannes

---

<div class="post-metadata">

**Author:** ![Dick\_Davies](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dick\_Davies](https://forum.ansible.com/u/Dick_Davies)\
**Post date:** [June 22, 2016, 11:36pm UTC](https://forum.ansible.com/t/ansible-forks-serial-and-all-that-just-for-one-group/21837/2 "2016-06-22T23:36:25Z")

</div>

I think you sort of answered your own question - serial: is related to  
a given play,  
so if that play is targeted against a group then tasks against thet  
group will complete  
on each server before the next one starts.A good example is bouncing  
servers while  
leaving enough active to keep your load balancer happy

I've always thought of forks as more to do with the ansible control  
host; if things can  
run in parallel they will, and you can safely ramp that up as high as  
you like as long  
as the control host has enough resources. This pays off well for e.g.  
package installs.

I might be missing something about your use case; why wouldn't you always want  
a serial: tagged play to run - well, serially?

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [June 23, 2016, 6:58pm UTC](https://forum.ansible.com/t/ansible-forks-serial-and-all-that-just-for-one-group/21837/3 "2016-06-23T18:58:50Z")

</div>

Because I just have one group of hosts that seems to need running with  
serial:1, but I do not want to handle all of my hosts that way.

But as ansible seems to be missing a possibility to switch this on/off  
just for one call or run, I might end up having to use serial in all  
of my plays...

Johannes
