include_tasks is dynamic and the tasks are either included (or not) at runtime. This has the advantage that if a "when" keyword excludes the include_tasks, then all the tasks are excluded as a group. This is opposed to import_tasks which happen at playbook parse time. The "when" keyword is inherited by each individual task that was imported. While the two are functionally equivalent for these use cases, import_tasks ends up being much slower, since ansible then has to compute a much larger set of tasks to skip at runtime. Using include_tasks is much faster, even at small scale (~50 hosts). Change-Id: I2db81d39b3294aa2784a340562f10fd9bf3fe9eechanges/10/697510/2
parent
9f4832fcc4
commit
6f8b2db26a
Loading…
Reference in new issue