Hi,
I wrote a role where I execute a task file for every interface of each target machine.
Unfortunately, when reaching the loop the engine allows only one target at a time to execute the included tasks and stall the others with NOOP.
How can I modify my code to have a normal linear flow (each task is performed on all the host at the same time)?
Info:
Ansible 2.4.1
Python 2.7.5
Serial unset
Default fork
include_task run on all host at the "same" time.
The first task the include_tasks is run on all host, default 5 hosts(fork) at the time.
When the fist task is finished on all hosts, it run the second tasks on all hosts and so on.
There is no difference between ordinary task and task in include_tasks.
It’s a little hard to say based on the small amount of information you have given, however an include_tasks is uniquely defined by 3 items:
the file being included
the args passed to the include (in most cases this is just item from a loop)
the parent of the include
This uniqueness is done for several reasons, the most common, is that we aren’t sure whether deviations from this uniqueness may cause a file with a different number of tasks to be inserted.
As such, if item is different per host, this causes noop tasks to be inserted. Otherwise we would get out of sync between the task being executed and the task header that is printed.
This is something I have been working onaddressing
, but have been delayed recently.It makes the assumption that as long as the filename is the same, that there are the same number of tasks within.
in my case the only changing factor is the array the include loops over, because I execute the inclusion for each selected network interface of each target.
So, I had to switch the play strategy to “free” to speed up the deployment process. However, it would be nice to review the NOOP injection policy.
Thanks.