# Ansible and specific switch info.

**URL:** <https://forum.ansible.com/t/ansible-and-specific-switch-info/31922>\
**Category:** Ansible Project\
**Created:** [January 7, 2020, 12:53pm UTC](https://forum.ansible.com/t/ansible-and-specific-switch-info/31922 "2020-01-07T12:53:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chr00ted](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chr00ted/32/2188_2.png) [@chr00ted](https://forum.ansible.com/u/chr00ted)\
**Post date:** [January 7, 2020, 12:53pm UTC](https://forum.ansible.com/t/ansible-and-specific-switch-info/31922/1 "2020-01-07T12:53:56Z")

</div>

I have the ip’s of all of my switches along with logon info. I’d like to somehow have ansible generate a list of all managed switches containing hostname, model number, and serial number. Is that possible?

---

<div class="post-metadata">

**Author:** ![chr00ted](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chr00ted/32/2188_2.png) [@chr00ted](https://forum.ansible.com/u/chr00ted)\
**Post date:** [January 7, 2020, 12:54pm UTC](https://forum.ansible.com/t/ansible-and-specific-switch-info/31922/2 "2020-01-07T12:54:32Z")

</div>

These are Cisco switches.

---

<div class="post-metadata">

**Author:** ![chr00ted](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chr00ted/32/2188_2.png) [@chr00ted](https://forum.ansible.com/u/chr00ted)\
**Post date:** [January 7, 2020, 3:19pm UTC](https://forum.ansible.com/t/ansible-and-specific-switch-info/31922/3 "2020-01-07T15:19:00Z")

</div>

I was able to get the data I needed using this example:  
[https://docs.ansible.com/ansible/latest/network/user\_guide/network\_best\_practices\_2.5.html](https://docs.ansible.com/ansible/latest/network/user_guide/network_best_practices_2.5.html)

---

<div class="post-metadata">

**Author:** ![chr00ted](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chr00ted/32/2188_2.png) [@chr00ted](https://forum.ansible.com/u/chr00ted)\
**Post date:** [January 7, 2020, 3:50pm UTC](https://forum.ansible.com/t/ansible-and-specific-switch-info/31922/4 "2020-01-07T15:50:01Z")

</div>

I noticed the example I am using does work, but if there is a switch stack, its not returning all the stack’s serial numbers.

---

<div class="post-metadata">

**Author:** ![chr00ted](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chr00ted/32/2188_2.png) [@chr00ted](https://forum.ansible.com/u/chr00ted)\
**Post date:** [January 7, 2020, 3:59pm UTC](https://forum.ansible.com/t/ansible-and-specific-switch-info/31922/5 "2020-01-07T15:59:03Z")

</div>

Nevermind:
