Ansible – Manage multi-threading in playbooks

In this post, I will show an example on how to manage multi-threading in an Ansible playbook.

The playbook will perform the following steps:

  • Connect on the Service-Now API. Use the CMDB table and retrieve a server list. This server list will contain some attributes. You will have to adapt with your own value. In this example the Service-Now attributes will be: name, sys_id and snow_iloip.
  • The next step will perform a call to the HP iLO API using the specific Ansible module on each list entries. Each call will be launched as a new thread and will not wait the end to run the next call.
  • The next step will wait all the call have been finished and collecting the step output
  • Finally we display the job output in two different ways

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Social Media Auto Publish Powered By :