# how to run one role out of a playbook host by host in serial one instead of linear or free

**URL:** <https://forum.ansible.com/t/how-to-run-one-role-out-of-a-playbook-host-by-host-in-serial-one-instead-of-linear-or-free/32460>\
**Category:** Ansible Project\
**Created:** [March 13, 2020, 10:28pm UTC](https://forum.ansible.com/t/how-to-run-one-role-out-of-a-playbook-host-by-host-in-serial-one-instead-of-linear-or-free/32460 "2020-03-13T22:28:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jelle\_de\_Jong](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@Jelle\_de\_Jong](https://forum.ansible.com/u/Jelle_de_Jong)\
**Post date:** [March 13, 2020, 10:28pm UTC](https://forum.ansible.com/t/how-to-run-one-role-out-of-a-playbook-host-by-host-in-serial-one-instead-of-linear-or-free/32460/1 "2020-03-13T22:28:46Z")

</div>

Hello everybody,

I got a role with a few tasks that do some calculations and writes down the results on a server, the next inventory\_host will use the caclulations to make a new one, now if these tasks are run by multiple inventory\_hosts at the same time (linear run) they do the calculation at the same time and write down the same result causing issues. How do a run a role with serial: 1 or a set of tasks in a role to be run host by host?

Kind regards,

Jelle de Jong

---

<div class="post-metadata">

**Author:** ![Jelle\_de\_Jong](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@Jelle\_de\_Jong](https://forum.ansible.com/u/Jelle_de_Jong)\
**Post date:** [March 14, 2020, 1:06pm UTC](https://forum.ansible.com/t/how-to-run-one-role-out-of-a-playbook-host-by-host-in-serial-one-instead-of-linear-or-free/32460/2 "2020-03-14T13:06:45Z")

</div>

I would like to request the feature to apply serial:1 to blocks inside a role.

I ended up in a futile attempt trying to use include and include\_tasks without luck, and ended moving my whole block of tasks to a bash script with a locking system that waited it turn to run. I then called he script from ansible, lots of extra work.

- name: create a include\_tasks to do a ipaddr calculation with throttle one  
include\_tasks:  
file: throttle01.yml  
apply:  
throttle: 1

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [March 15, 2020, 3:57pm UTC](https://forum.ansible.com/t/how-to-run-one-role-out-of-a-playbook-host-by-host-in-serial-one-instead-of-linear-or-free/32460/3 "2020-03-15T15:57:27Z")

</div>

You can use throttle on a block  
[https://docs.ansible.com/ansible/latest/reference\_appendices/playbooks\_keywords.html#id4](https://docs.ansible.com/ansible/latest/reference_appendices/playbooks_keywords.html#id4)

---

<div class="post-metadata">

**Author:** ![klingac](https://avatars.discourse-cdn.com/v4/letter/k/ecd19e/32.png) [@klingac](https://forum.ansible.com/u/klingac)\
**Post date:** [March 16, 2020, 8:44am UTC](https://forum.ansible.com/t/how-to-run-one-role-out-of-a-playbook-host-by-host-in-serial-one-instead-of-linear-or-free/32460/4 "2020-03-16T08:44:00Z")

</div>

You can use throttle on block, hovewer it will not work as you need

[https://github.com/ansible/ansible/issues/64659#issuecomment-564604298](https://github.com/ansible/ansible/issues/64659#issuecomment-564604298)

Dne neděle 15. března 2020 16:57:44 UTC+1 Kai Stian Olstad napsal(a):
