Ansible Network
Automation
Leveraging Ansible to streamline network management tasks — automating configuration retrieval, connectivity verification, and router group management against a Cisco 1900 series router.
🎯 Project Overview
This project demonstrates the use of Ansible — a powerful agentless IT automation platform — to manage and interact with a Cisco 1900 router programmatically from an Ubuntu controller. Rather than logging in manually via SSH for every configuration task, Ansible modules execute commands across the network in a repeatable, auditable way.
🔍 Why It Was Built
Manual network management does not scale. This project explores how automation tools like Ansible can reduce human error, speed up repetitive tasks, and bring software-development best practices — such as version control and idempotency — into network operations. It also demonstrates the practical application of Network Automation skills in an IOS environment.
🏗️ Setup & Configuration
The project involved the following key configuration steps:
- Install Ansible on the Ubuntu controller machine.
- Configure
ansible.cfg— set host key checking, connection type, and credentials. - Update the hosts inventory file — define a
[ciscoRouters]group pointing to192.168.56.107. - Configure SSH on the Cisco 1900 — assign IP, enable SSH, and test reachability from the controller.
- Run Ansible modules — execute
pingandios_commandmodules against the router group.
⚙️ Key Commands
# Hosts inventory entry
[ciscoRouters]
192.168.56.107
# Verify connectivity with Ansible ping module
ansible ciscoRouters -m ping
# Pull interface brief from router
ansible ciscoRouters -m ios_command -a "commands='show ip interface brief'"
# Run a playbook
ansible-playbook -i hosts router_config.yml
📊 Key Achievements
- Router Group Creation: Successfully grouped the Cisco 1900 in the Ansible inventory under
ciscoRouters. - Connectivity Verification: Used the Ansible
pingmodule to confirm network reachability and reliability. - Configuration Retrieval: Pulled interface configuration data using
ios_commandwithshow ip interface brief. - SSH Automation: Configured SSH fingerprint handling in
ansible.cfgfor seamless non-interactive operation.