Chapter 4 Where to Start with Network Automation?
For diagrams, tables, or exact code formatting, .
https://docs.ansible.com/ansible/latest/modules/ios_facts_module.html More on Cisco and Ansible: https://www.ansible.com/integrations/networks/cisco/ Ansible Module – ios_command
Another way of gathering information from the network is using the simple and easy to use ios_command module. This module can be used to gather output of IOS show commands. Become comfortable with ios_command. Build on the ability to gather information from the network and use the module to change the network. Here are some ideas of the show commands that can be performed using ios_command module to gather network reconnaissance:
show cdp neighbors show spanning-tree show spanning-tree blockedports show ip ospf neighbors show ip route show ip route vrf show interface show interface status show version show inventory show ip interface brief show arp show mac-address table show etherchannel summary show vlan show access-list show policy-map show tech
It might seem impossible, however any or all the above commands can be performed on any or all the network devices on demand or at scheduled times using Ansible playbooks. If the output of the commands is kept in the master branch, when changed, TFS will show the change history for these output files. This makes it easier to detect state changes in the network. This could help keep track of topology changes or hint to potential problems or unreported outages. Manipulate the output of the commands and store them in the centralized repository for version and change control.
More on the ios_command module can be found here: https://docs.ansible.com/ansible/latest/modules/ios_command_module.html#ios-command-module One-Time Ansible Playbooks / Tactical Changes
The automated network reconnaissance has led to some discoveries on the network that need to be addressed such as:
