Training Course for Ansible Automation Platform
This project is maintained by ericzji
Demonstrate the use of Ansible Tower workflow for F5 BIG-IP. Workflows allow you to configure a sequence of disparate job templates (or workflow templates) that may or may not share inventory, playbooks, or permissions.
For this exercise we will use workflow to achieve the same as the create_vs job template, while at the same time adding failure handling for each job.
Following what we learned from Lab 4.2
, create the following job templates with the respective playbook:
Job template Name | Playbook |
---|---|
Create node | create_node.yml |
Create pool | create_pool.yml |
Create virtual server | create_virtualserver.yml |
Rollback node deploy | rollback_node_deploy.yml |
Rollback pool deploy | rollback_pool_deploy.yml |
Rollback virtual server deploy | rollback_vs_deploy.yml |
Apart from above, we use the same template parameters as Lab 4.2
for each of the above templates,:
Parameter | Value |
---|---|
Name | |
Job Type | Run |
Inventory | Workshop Inventory |
Project | Workshop Project |
Playbook | |
Credential | Workshop Credential |
Here is one example of templates: Create node:
Click on the Templates link on the left menu.
Click on the green button. Select the Workflow Template.
Fill out the the form as follows:
Parameter | Value |
---|---|
Name | Workshop Workflow |
Organization | Default |
Inventory | Workshop Inventory |
Save
buttonWhen you click the SAVE the WORKFLOW VISUALIZER should automatically open. If not, click on the blue WORKFLOW VISUALIZER button.
By default only a green START button will appear. Click on the START button.
The ADD A TEMPLATE window will appear on the right. Select the Create node
Job Template that was created in previous step(whatever you named it!).
The Create node
job template is now a node. Job or workflow templates are linked together using a graph-like structure called nodes. These nodes can be jobs, project syncs, or inventory syncs. A template can be part of different workflows or used multiple times in the same workflow. A copy of the graph structure is saved to a workflow job when you launch the workflow.
Select the Create node
Job Template. Use the only run option of Always
. Click the green SELECT button.
Hover over the Create node
node and click the green + symbol. The ADD A TEMPLATE will appear again.
Create pool
job template. For the Run parameter select On Success from the drop down menu.Click the green SELECT button.
Hover over the Create pool
node and click the green + symbol. The ADD A TEMPLATE will appear again.
Create virtual server
job template. For the Run parameter select On Success from the drop down menu.Click the green SELECT button.
Hover over the Create node node and click the green + symbol. The ADD A TEMPLATE will appear again.
Click the green SELECT button.
Hover over the Create pool node and click the green + symbol. The ADD A TEMPLATE will appear again.
Click the green SELECT button.
Hover over the Create virtual server node and click the green + symbol. The ADD A TEMPLATE will appear again.
Click the green SELECT button.
Return to the Templates window
Click the rocket ship to launch the Workshop Workflow workflow template.
At any time during the workflow job you can select an individual job template by clicking on the node to see the status.
Next, we will show a failed job template for the workflow, where a rollback is performed.
Click on the Templates
link on the left menu.
Select template Create virtual server
Change the PLAYBOOK from create_virtualserver.yml
to create_virtualserver_error.yml
The create_virtualserver_error.yml
playbook will configure the Virtual Server, but tries to attach a pool http_pool_error
which does not exist. Therefore, the addition of virtual server will fail, and the Rollback virtual server deploy
node will be triggered.
save
button.Return to the Templates window, cick the rocket ship to launch the Workshop Workflow workflow template again.
Click on Local Traffic. then click on Virtual Servers, Pools, and Nodes. You should see that Rollback virtual server deploy
kicked in and removed all BIG-IP configuration.
Finally, we revert the configuration, and make it ready for next lab:
Create virtual server
create_virtualserver.yml
save
button.You have
You have completed lab exercise 4.2
Click here to return to the Ansible Network Automation Workshop