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?
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