cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Asset and lifecycle management using APIC-EM and Ansible

Earlier this year I blogged about Using APIC-EM as the single source of truth. Since then, APIC-EM as become GA and I've updated my Ansible module shown in that post to use the GA release.

A WWT customer recently requested the capability to automate the collection of output from a series of 'show' commands from routers and switches. An example of the Ansible playbook to accomplish that task is available on GitHub.

We can leverage that development effort into a demonstration of using APIC-EM and Ansible to provide an Asset and Lifecycle management tool.


For this use case, we will use the APIC-EM database of discovered devices to provide an inventory of routers to the Ansible playbook, and specify the commands to be issued on the router.  For example:

APIC_EM_vars.png


However, rather than issue the commands on all the devices in the inventory, we will use the facts provided by APIC-EM to filter on only selected devices in the inventory.  This playbook will only issue the  commands for Cisco 2911 routers running IOS version 15.3(3)M5.

APIC_EM_when.png

The output of the show commands are stored in files specific to each device in inventory, and following the execution of the playbook, we can glean additional information from the collected data. As an example, we can grep the files to determine which devices  have 4 Port GE Non-POE EHWICs based on the captured output.


By combining APIC-EM, Ansible and the WWT developed modules, we can easily identify network devices which meet our selection criteria by using APIC-EM for an inventory and by modifying a simple Ansible playbook and issuing basic Linux commands.


2 Comments
arpandey
Beginner

There is already a solution to achieve this using Cisco Advanced Services - Service offering called NOS. This contains a Collector which collects various command data output from network elements and uses it for analyzing and reporting on Network health of such elements.

joelwking
Enthusiast

I was a Network Consulting Engineer at Cisco in the late 1990's, working in then what was called Network Supported Accounts, which is now Cisco Advanced Services. We used a tool called NatKit, which I believe an early implementation of the tool you mention. - Joel

Create
Recognize Your Peers
Content for Community-Ad