This page looks best with JavaScript enabled

Speeding up Ansible

 ·  🎃 kr0m

Ansible can be a bit slow when there are many tasks to execute. To speed up the process, we will enable pipelining, which reduces the number of ssh connections required to execute the playbook. This mode of operation has only one drawback if we are using the requiretty option in the sudo config on the servers being managed.

We enable it and contrast the time difference in executing a playbook with 49 tasks:

vi /etc/ansible/ansible.cfg

[ssh_connection]
pipelining = True

Without pipelining:

real 1m37,096s

With pipelining:

real 0m33,997s
If you liked the article, you can treat me to a RedBull here