2021-03-26 20:55:43 +00:00
---
2021-04-22 08:37:48 +00:00
## This playbook collects the device facts and prints out key information
2021-03-26 20:55:43 +00:00
2021-04-22 08:37:48 +00:00
- name : Audit devices and print key information
2022-05-07 15:54:22 +00:00
hosts : baguleykit
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
2021-04-21 10:04:11 +00:00
ios_facts :
2021-03-26 20:55:43 +00:00
gather_subset : all
register : current_config
- name : Print device identity info
debug :
msg : "{{ current_config.ansible_facts.ansible_net_hostname }} is reachable and the OS is {{ current_config.ansible_facts.ansible_net_version }}. SN is {{ current_config.ansible_facts.ansible_net_serialnum }}. Model is {{current_config.ansible_facts.ansible_net_model }}"
2021-04-22 08:37:48 +00:00
- name : Collect interface, routing and IOX runtime information
ios_command :
commands :
- show ip interface brief
- show interface description
- show ip route
- show ip arp
- show iox
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]
- name : Print IOx information
debug :
var : runtime_information.stdout_lines[4]
2021-03-26 20:55:43 +00:00