# Jinja2 - Cisco Access-list

**URL:** <https://forum.ansible.com/t/jinja2-cisco-access-list/25346>\
**Category:** Ansible Project\
**Created:** [August 28, 2017, 7:05pm UTC](https://forum.ansible.com/t/jinja2-cisco-access-list/25346 "2017-08-28T19:05:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juraj\_Papic1](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@Juraj\_Papic1](https://forum.ansible.com/u/Juraj_Papic1)\
**Post date:** [August 28, 2017, 7:05pm UTC](https://forum.ansible.com/t/jinja2-cisco-access-list/25346/1 "2017-08-28T19:05:30Z")

</div>

Hi all

I searching for a Jinja2 that can help me with my cisco router acls.

And I found this but not sure if this will help me create my acls

{% for key, value in vars[‘access\_lists’]|dictsort(false, ‘key’) %}  
{% if value[‘type’] == ‘standard’ %}  
{% for entry in value[‘entries’] %}  
{% if ‘action’ in entry %}  
{% if entry[‘source\_wildcard’] == ‘0.0.0.0’ %}

- parents:  
lines:
- access-list {{ value[‘number’] }} {{ entry[‘action’] }}{{ entry[‘whitespace’] }}{{ entry[‘source\_network’] }}  
{% elif entry[‘source\_network’] == ‘any’ %}
- parents:  
lines:
- access-list {{ value[‘number’] }} {{ entry[‘action’] }}{{ entry[‘whitespace’] }}{{ entry[‘source\_network’] }}  
{% else %}
- parents:  
lines:
- access-list {{ value[‘number’] }} {{ entry[‘action’] }}{{ entry[‘whitespace’] }}{{ entry[‘source\_network’] }} {{ entry[‘source\_wildcard’] }}  
{% endif %}  
{% endif %}  
{% if ‘remark’ in entry %}
- parents:  
lines:
- access-list {{ value[‘number’] }} remark {{ entry[‘remark’] }}  
{% endif %}  
{% endfor %}  
{% endif %}  
{% endfor %}

Any ideas?

Thanks
