Suppose you are running a ansible playbook with multiple tasks and want to print execution time of each task, then do the below changes.

Lets see the below sample playbook execution . In this ouput we dont know how much it took for each task execution.

For enabling the changes, we need to set the callback_whitelist = profile_tasks inside ansible.cfg file.

 

Now run the same playbook in ansible again.