# Simple cisco IOS show version

**URL:** <https://forum.ansible.com/t/simple-cisco-ios-show-version/22264>\
**Category:** Ansible Project\
**Created:** [August 10, 2016, 1:58pm UTC](https://forum.ansible.com/t/simple-cisco-ios-show-version/22264 "2016-08-10T13:58:07Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![Surjeet\_Singh](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@Surjeet\_Singh](https://forum.ansible.com/u/Surjeet_Singh)\
**Post date:** [January 31, 2018, 6:52am UTC](https://forum.ansible.com/t/simple-cisco-ios-show-version/22264/21 "2018-01-31T06:52:12Z")

</div>

Hi,

I would like to share that i managed to collect inventory information with only minor changes in ansible playbook.

sharing just to help other people who new learner like me.

# write facts in inventory

- name: write the inventory in into file  
copy:  
content: |  
MGMT\_IP;HOSTNAME;MODEL;VERSION;IMAGE;  
{% for host in ansible\_play\_hosts %}  
{{ hostvars[host].inventory\_hostname}};{{ hostvars[host].facts\_output.ansible\_facts.ansible\_net\_hostname }};{{ hostvars[host].facts\_output.ansible\_facts.ansible\_net\_model }};{{ hostvars[host].facts\_output.ansible\_facts.ansible\_net\_version }};{{ hostvars[host].facts\_output.ansible\_facts.ansible\_net\_image }}  
{% endfor %}

dest: /etc/ansible/facts/systems.csv  
backup: yes

output will look like below after minor changes in excel.

[Previous page](https://forum.ansible.com/t/simple-cisco-ios-show-version/22264.md?page=1)
