Exercise 6: Event-Driven Ansible - New Device Added Workflow
Overview
Understanding Workflow Job Templates
A Workflow Job Template is a series of connected Job Templates that are executed in a specific order to achieve a desired outcome. Meanwhile, an individual Job Template handles tasks in a single Playbook.
Workflow Job Templates are designed to manage more complex automation scenarios involving multiple playbooks and decision-making processes (success or failure conditions for each).
Only Workflow Job Templates have the Workflow Visualizer icon to connect the Job Templates in a Graphical User Interface.
|
Remember, do not confuse a Job Template with a Jinja template, or with a Workflow Job Template. They are three separate things! |
Task 1: Explore the Job Workflow Template
Overview
We have already created a Job Workflow Template with the previous Job Templates to speed things up. This Workflow will be associated with the Rulebook condition of a New Device Added in netbox-webhooks.yml, and will be called Provision New Device Workflow just like we specified in the run_workflow_template action.
Access the Workflow Template
Step 1: Switch to the AAP tab and log in if required.
Step 2: Click the Automation Execution dropdown in the sidebar to expand it.
Step 3: Navigate to menu:Automation Execution[Templates].
Step 4: Look for the Provision New Device Workflow in the list and click on it to explore it.
Task 2: Examine the Workflow Visualizer
Understanding the Workflow Structure
In this view, you can see a graphical representation of the relationship between the different Job Templates.
Step 1: Review the workflow structure displayed in the Workflow Visualizer.
You should see a workflow composed of two Job Templates:
-
Configure NTP Servers - Called
NTPfor short -
Configure Login Banner - Called
Bannerfor short
|
The Workflow Visualizer shows the execution order and any conditional logic between Job Templates. This makes it easy to understand and manage complex automation workflows. |
Task 3: Launch the Workflow
Manual Workflow Execution
Now let’s test the workflow by launching it manually.
Step 1: Within the same Workflow Visualizer screen, locate the three dots icon right below the workflow name at the top left.
Step 2: Click the 3 dots icon and select Launch workflow from the dropdown menu.
Step 3: The workflow will run the two Job Templates on all existing devices in our NetBox Dynamic Inventory.
Step 4: Monitor the workflow execution and verify that both Job Templates complete successfully.
|
In the next exercise, we will see how this workflow gets triggered automatically when we add a device to our site in NetBox. This demonstrates the power of Event-Driven Ansible! |
Summary
In this exercise, you’ve accomplished the following:
-
Explored a pre-configured Workflow Job Template
-
Learned how Workflow Job Templates connect multiple Job Templates
-
Used the Workflow Visualizer to understand the workflow structure
-
Manually launched a workflow to provision device configurations
This workflow is now ready to be automatically triggered by Event-Driven Ansible when new devices are added to NetBox.
Next Steps
Excellent work! You’ve successfully explored and tested a Workflow Job Template that will be automatically triggered by Event-Driven Ansible.
Step 1: Press the Next button below to go to the next section once you’ve completed the task to begin exploring Event-Driven Ansible in action.
Troubleshooting
|
NetBox Startup Issues NetBox needs a couple of minutes to get started. If you can’t see the NetBox login screen in the NetBox tab: Step 1: Go to the netbox term tab. Step 2: Run the following command to stop NetBox:
Step 3: Run the following command to restart NetBox services:
Step 4: Wait 2-3 minutes for the services to fully start, then try accessing NetBox again. |
End of Exercise 6



