Network Fact Gathering & Reporting - Solution Guide
Overview
Every automation journey begins by exploring a few simple automated tasks. In this use case, we'll walk through a simple network automation use case to help you gather facts about your network which can be exported for compliance reporting. For purposes of this article, we will be demonstrating the automation of Cisco IOS devices, but this automation could easily be applied to Arista, Juniper or other network components supported by various Ansible Content Collections.
Operational impact: None
Business value drivers
- Increased productivity
- Support for compliance
Technical value drivers
- Increased network visibility
- Simplified compliance reporting
Recommended demo and self-paced labs:
Prerequisites
This solutions guide assumes a working knowledge of YAML, Ansible Playbooks, the Ansible VS Code extension, execution environments, Ansible navigator, and Git. If you are new to Ansible Automation Platform, we strongly recommend the free Red Hat technical overview course or these learning paths:
- Foundations of Ansible
- YAML essentials for Ansible
- Get started with Ansible Playbooks
- Get started with the Ansible VS Code extension
- Get started with Ansible builder
- Building an execution environment
- Get started with Ansible navigator
The Ansible Content Collections referenced in this guide can be found in the Red Hat Hybrid Cloud Console, which is available to current subscribers. Not currently an Ansible Automation Platform customer? Sign up for a free 60-day trial.
Featured Ansible Content Collections
Ansible / Ansible Automation Platform features used
- Ansible Playbooks
- Ansible builder / execution environments
- Ansible navigator
- Automation hub
- Automation job templates
Other:
- Github
Step 1: Network fact gathering
- Use thenetwork.ios.facts.facts utility provided in the Cisco IOS certified collection to create a playbook and save to the Git repository for your project.
---
- name: Gather information from routers
hosts: cisco
gather_facts: yes
tasks:
- name: Gather router facts
cisco.ios.ios_facts:
register: cisco_facts
- name: Display router facts
ansible.builtin.debug:
var: cisco_facts
- Create a job template using your project. Save your job template as Network configuration update, then select Launch to run the template.
Step 2: Export network facts to a report or create dynamic documentation
- From here, you can export your data to a reporting tool such as Splunk, Grafana, etc., use a Jinja2 template to publish via HTML, or create simple dynamic documentation / dashboard:
Next Steps:
- Learn how to back up your Cisco network devices, then make some basic configuration updates.
Comments