# shut unused cisco switch interfaces

**URL:** <https://forum.ansible.com/t/shut-unused-cisco-switch-interfaces/28789>\
**Category:** Ansible Project\
**Created:** [October 15, 2018, 5:51pm UTC](https://forum.ansible.com/t/shut-unused-cisco-switch-interfaces/28789 "2018-10-15T17:51:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_Aljawad](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@Ahmed\_Aljawad](https://forum.ansible.com/u/Ahmed_Aljawad)\
**Post date:** [October 15, 2018, 5:51pm UTC](https://forum.ansible.com/t/shut-unused-cisco-switch-interfaces/28789/1 "2018-10-15T17:51:10Z")

</div>

Is there is any way i can loop on all the devices interfaces and shut all the Down Down ports ?

---

<div class="post-metadata">

**Author:** ![Brad2](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Brad2](https://forum.ansible.com/u/Brad2)\
**Post date:** [October 16, 2018, 11:52am UTC](https://forum.ansible.com/t/shut-unused-cisco-switch-interfaces/28789/2 "2018-10-16T11:52:50Z")

</div>

I don’t currently have any switches to test against, but I would think you can get the interface status with ios\_facts with the ansible\_net\_interfaces giving you a hash of the interface status. From that, you should be able to use ios\_interface to mark it down. [ansible check of IOS interfaces](https://gist.github.com/cgascoig/5deeb9310c9b8ac04d4c6567d64ac905) gives a similar example.
