In this chapter, we will outline how to automate Cisco IOS-based devices using Ansible. We will explore the different modules available in Ansible to automate configuration and collect network information from Cisco IOS devices. This chapter will be based on the following sample network diagram, and we will walk through how we can implement this network design using Ansible:
The following table outlines the management IP addresses on the Cisco nodes, which Ansible will use to connect to the devices:
Device |
Role |
Vendor |
MGMT Port |
MGMT IP |
access01 |
Access switch |
Cisco IOS 15.1 |
Ethernet0/0 |
172.20.1.18 |
access02 |
Access switch |
Cisco IOS 15.1 |
Ethernet0/0 |
172.20.1.19 |
core01 |
Core switch |
Cisco IOS 15.1 |
Ethernet0/0 |
172.20.1.20 |
core02 |
Core switch |
Cisco IOS 15.1 |
Ethernet0/0 |
172.20.1.21 |
... |