Ansible workflow combines one or more resources links together in a sequence of disparate resources with conditional job results. This allows us to create a template for each task and combine in one workflow based on the results. The following resource could co-exist in workflows.
- inventory source syncs
- job templates
- project syncs
- workflow templates
This article will walk you through to combine to templates in one workflow based on the template result. For test simulation, we will use the following templates.
- Ping the host – Template 1
- If we get the ping response, check the filesystem utilization on the host. – Template 2
1.Login to Ansible Tower / AWX as admin or organization admin.
2. Navigate to the template tab and click on Add icon (+) and select Workflow.
3. Enter the workflow template information.
4. Click on “start” to combine the existing templates.
5. Select the first template for the workflow.
6. Select the first template box and click on “+” to add the second template.
7. Choose the second template from the list and configure the condition. Save the workflow template.
8. Trigger the workflow template. Here you could see that the first template ran successfully and the second template has been triggered.
9. Here is the final state of the workflow template.
10. Click on the details link of each template to know more information.
We have successfully created a first Ansible Tower workflow and executed successfully. You could apply the same logic for combining other automation tasks which need to be triggered based on another job.
Share it! Comment it !! Be Sociable !!
Vijay says
Good Job !! Very good Detailed information really helpful.