Quantcast
Channel: Lingesh, Author at UnixArena
Viewing all articles
Browse latest Browse all 370

Ansible Tower / AWX – Creating Workflow Template

$
0
0

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.

Creating New Template - Ansible
Creating New Template – Ansible

 

3. Enter the workflow template information.

Ansible Workflow Template
Ansible Workflow Template

 

4. Click on “start” to combine the existing templates.

Start Ansible Tower AWX Workflow
Start Ansible Tower AWX Workflow

 

5. Select the first template for the workflow.

Select the first template for workflow - AWX - Ansible Tower
Select the first template for workflow – AWX – Ansible Tower

 

6. Select the first template box and click on “+” to add the second template.

Click on Add icon to add second template - Ansible AWX
Click on Add icon to add second template – Ansible AWX

 

7. Choose the second template from the list and configure the condition. Save the workflow template.

On Success trigger next template - AWX Tower
On Success trigger next template – AWX Tower

 

8. Trigger the workflow template. Here you could see that the first template ran successfully and the second template has been triggered.

Execute the workflow template - Ansible AWX Tower
Execute the workflow template – Ansible AWX Tower

 

9. Here is the final state of the workflow template.

Workflow test - Ansible AWX
Workflow test – Ansible AWX

 

10. Click on the details link of each template to know more information.

Ansible Tower AWX - Job template details

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 !!

The post Ansible Tower / AWX – Creating Workflow Template appeared first on UnixArena.


Viewing all articles
Browse latest Browse all 370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>