# need assistance to gather access list rules associated with public ip's only using ansible

**URL:** <https://forum.ansible.com/t/need-assistance-to-gather-access-list-rules-associated-with-public-ips-only-using-ansible/35635>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [August 18, 2021, 3:27pm UTC](https://forum.ansible.com/t/need-assistance-to-gather-access-list-rules-associated-with-public-ips-only-using-ansible/35635 "2021-08-18T15:27:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [August 18, 2021, 3:27pm UTC](https://forum.ansible.com/t/need-assistance-to-gather-access-list-rules-associated-with-public-ips-only-using-ansible/35635/1 "2021-08-18T15:27:57Z")

</div>

You have to use regex patterns to match the desired ACL’s

---

<div class="post-metadata">

**Author:** ![Melvin\_Satheesan](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@Melvin\_Satheesan](https://forum.ansible.com/u/Melvin_Satheesan)\
**Post date:** [August 19, 2021, 6:24am UTC](https://forum.ansible.com/t/need-assistance-to-gather-access-list-rules-associated-with-public-ips-only-using-ansible/35635/2 "2021-08-19T06:24:41Z")

</div>

Globally acceptable internal IP pool will be 172\*, 10\* and 192\*. So all other ips will be public.  
Now list all the ips in all acl, append it to a template file, filter it based on desired port, use regular expression (^)as said below and get it concatenated to same file.
