# Ansible Playbook for Gathering and Verifying Access Lists on Cisco Switches

**URL:** <https://forum.ansible.com/t/ansible-playbook-for-gathering-and-verifying-access-lists-on-cisco-switches/38081>\
**Category:** Ansible Project\
**Created:** [June 11, 2023, 8:59pm UTC](https://forum.ansible.com/t/ansible-playbook-for-gathering-and-verifying-access-lists-on-cisco-switches/38081 "2023-06-11T20:59:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex5](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@Alex5](https://forum.ansible.com/u/Alex5)\
**Post date:** [June 11, 2023, 8:59pm UTC](https://forum.ansible.com/t/ansible-playbook-for-gathering-and-verifying-access-lists-on-cisco-switches/38081/1 "2023-06-11T20:59:04Z")

</div>

Hi,  
I need assistance with writing an Ansible playbook. The playbook should be able to gather the access lists available on a Cisco switches and then display which access list is applied to each interface or line vty. I have already managed to gather the access lists and save them into a CSV file. However, I am unsure about how to proceed with the second step, which involves checking if an access list is applied to a specific interface or line vty. Could you please assist me in resolving this issue?

Thank you for your assistance.

---

<div class="post-metadata">

**Author:** ![KB-perByte](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kb-perbyte/32/541_2.png) [@KB-perByte](https://forum.ansible.com/u/KB-perByte)\
**Post date:** [June 12, 2023, 5:21am UTC](https://forum.ansible.com/t/ansible-playbook-for-gathering-and-verifying-access-lists-on-cisco-switches/38081/2 "2023-06-12T05:21:32Z")

</div>

Hey Alex,  
You may check the [acl\_interfaces](https://github.com/ansible-collections/cisco.ios/blob/main/plugins/modules/ios_acl_interfaces.py) and use the gathered state to gather facts related to the acls applied on any interface.

Regards,
