# Changing serial mode per task in playbook?

**URL:** <https://forum.ansible.com/t/changing-serial-mode-per-task-in-playbook/36284>\
**Category:** Ansible Project\
**Created:** [February 3, 2022, 9:08am UTC](https://forum.ansible.com/t/changing-serial-mode-per-task-in-playbook/36284 "2022-02-03T09:08:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Bozic](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@Martin\_Bozic](https://forum.ansible.com/u/Martin_Bozic)\
**Post date:** [February 3, 2022, 9:08am UTC](https://forum.ansible.com/t/changing-serial-mode-per-task-in-playbook/36284/1 "2022-02-03T09:08:29Z")

</div>

Hi everyone,

I’d like do a following scenario:

- commit a change in Puppet repo which has config for servers
- before this commit gets pulled in by Puppet daemons on servers I want to force
- run the Ansible playbook
- task1: stop Puppet daemons on all servers at once (parallel task)
- task2: serially run an an Ansible task community.general.puppet on each server

I already do rolling updates with “serial: 1” in all the updates. Considering on the format of the playbooks and documentation it seems to me I’d have to make two separate playbooks, one with parallel execution and one with serial? Or am I wrong and it can be done within one playbook? Maybe it’s possible to work around the problem with include\_tasks or import\_tasks?

Martin

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [February 3, 2022, 12:37pm UTC](https://forum.ansible.com/t/changing-serial-mode-per-task-in-playbook/36284/2 "2022-02-03T12:37:05Z")

</div>

You can have multiple plays within one playbook.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [February 3, 2022, 4:18pm UTC](https://forum.ansible.com/t/changing-serial-mode-per-task-in-playbook/36284/3 "2022-02-03T16:18:00Z")

</div>

also 'throttle', it is not the same as 'serial' but it is what many  
people actually want (serial keyword has many implications aside from  
reducing parallelism).

---

<div class="post-metadata">

**Author:** ![Martin\_Bozic](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@Martin\_Bozic](https://forum.ansible.com/u/Martin_Bozic)\
**Post date:** [February 4, 2022, 1:30pm UTC](https://forum.ansible.com/t/changing-serial-mode-per-task-in-playbook/36284/4 "2022-02-04T13:30:03Z")

</div>

Thanks for both of the suggestions! I tried both and figured out that multiple plays in one playbook with the second play using “serial: 1” works for me alright.

Thanks,  
Martin

V V čet., 3. feb. 2022 ob 17:18 je oseba Brian Coca \<[bcoca@redhat.com](mailto:bcoca@redhat.com)\> napisala:
