2021-03-26 20:55:43 +00:00
---
2022-06-27 09:55:16 +00:00
## This playbook collects the device facts and prints out key information. It supports only basice device features and does not supply full information
## for devices which feature VRFs or multi-instance capabilities.
2021-03-26 20:55:43 +00:00
2021-04-22 08:37:48 +00:00
- name : Audit devices and print key information
2023-11-13 15:18:28 +00:00
hosts : evengkit
2021-03-26 20:55:43 +00:00
gather_facts : false
2021-04-21 10:04:11 +00:00
connection : network_cli
2021-03-26 20:55:43 +00:00
roles :
- common
tasks :
- name : Collect device configuration
2022-06-27 09:55:16 +00:00
cisco.ios.ios_facts :
2021-03-26 20:55:43 +00:00
gather_subset : all
- name : Print device identity info
debug :
2022-10-12 09:15:42 +00:00
msg : "{{ ansible_facts.net_hostname }} is reachable and the OS is {{ ansible_facts.net_version }}. SN is {{ ansible_facts.net_serialnum }}. Model is {{ansible_facts.net_model }}"
2021-03-26 20:55:43 +00:00
2022-10-12 09:15:42 +00:00
- name : Collect interface, routing and device runtime information fo L3 devices
2022-06-27 09:55:16 +00:00
cisco.ios.ios_command :
2021-04-22 08:37:48 +00:00
commands :
- show ip interface brief
- show interface description
2022-10-12 09:15:42 +00:00
- '{% if "2960" not in ansible_facts.net_model %} show ip route {% else %} show run | i default-gateway {% endif %}'
2021-04-22 08:37:48 +00:00
- show ip arp
2022-05-08 18:52:51 +00:00
- show version
2021-04-22 08:37:48 +00:00
register : runtime_information
- name : Print interface information
debug :
var : runtime_information.stdout_lines[0]
- name : Print interface description
debug :
var : runtime_information.stdout_lines[1]
- name : Print routing information
debug :
var : runtime_information.stdout_lines[2]
- name : Print ARP information
debug :
var : runtime_information.stdout_lines[3]
2022-10-12 09:15:42 +00:00
- name : Print device information
2021-04-22 08:37:48 +00:00
debug :
2023-11-13 15:18:28 +00:00
var : runtime_information.stdout_lines[4]