From the course: Ansible: From Basics to Guru by Pearson

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Managing parallelism

Managing parallelism

In this video, we'll talk about parallelism. So the first task in a play is executed on all managed hosts before moving over to the next task. That's a default behavior. And by default, this happens on five hosts simultaneously. Now, that is because task execution creates workload as well as network load. And in some cases, particularly when you are managing network devices, that may be way too much. And for that reason, default setting is limited. Now, if a control host as well as a network can handle it, it is safe to increase the number of concurrent tasks to get a better performance. To do so, you use forks is number in the Ansible.cfg, or the minus F followed by a number option while running your Ansible commands. You should be careful increasing this parameter if processing is happening on the control node. That's particularly the case if you're managing network devices. In all other cases, you should be safe. And particularly if you are managing large numbers of nodes, you…

Contents