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

1,676 views
Skip to first unread message

Johannes Kastl

unread,
Jun 22, 2016, 3:00:36 PM6/22/16
to ansible...@googlegroups.com
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

signature.asc

Dick Davies

unread,
Jun 22, 2016, 7:36:34 PM6/22/16
to ansible list
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?
> --
> 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 ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/576AE046.7020708%40ojkastl.de.
> For more options, visit https://groups.google.com/d/optout.

Johannes Kastl

unread,
Jun 23, 2016, 2:59:01 PM6/23/16
to ansible...@googlegroups.com
On 23.06.16 01:36 Dick Davies wrote:

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

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

signature.asc
Reply all
Reply to author
Forward
0 new messages