Read this in other languages: English, 日本語.
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.1
, 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.1
for each of the above templates,:
Parameter | Value |
---|---|
NAME | |
JOB TYPE | Run |
INVENTORY | Workshop Inventory |
PROJECT | Workshop Project |
PLAYBOOK | |
CREDENTIAL | BIGIP |
Here is the template example of Create node:
Click on the Templates link on the left menu.
Click on the green button and select the Workflow Template.
Fill out the form as follows:
Parameter | Value |
---|---|
NAME | Workshop Workflow |
ORGANIZATION | Default |
INVENTORY | Workshop Inventory |
Click on the Save
button
When 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 NODE window will appear on the right. Select the Create node
Job Template that was created in previous step (or 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.
Click the green SELECT button.
Hover over the Create node
node and click the green + symbol. The ADD A NODE will appear again.
Select the 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 NODE will appear again.
Select the 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 NODE will appear again.
Select the Rollback node deploy job template. For the Run parameter select On Failure from the drop down menu.
Click the green SELECT button.
Hover over the Create pool node and click the green + symbol. The ADD A NODE will appear again.
Select the Rollback pool deploy job template. For the Run parameter select On Failure from the drop down menu.
Click the green SELECT button.
Hover over the Create virtual server node and click the green + symbol. The ADD A NODE will appear again.
Select the Rollback virtual server deploy job template. For the Run parameter select On Failure from the drop down menu.
Click the green SELECT button.
Click the green SAVE 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.
Scroll down and click the green save
button.
Return to the Templates window, click the rocket ship to launch the Workshop Workflow workflow template again.
Login to the F5 BIG-IP with your web browser to see what was configured.
Click on Local Traffic then 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:
Click on the Templates link on the left menu. Select template Create virtual server
Change the PLAYBOOK back to create_virtualserver.yml
Scroll down and click the green save
button.
You have
You have completed lab exercise 4.2
Click here to return to the Ansible Network Automation Workshop