# Error messages

**URL:** <https://forum.ansible.com/t/error-messages/33895>\
**Category:** Ansible Project\
**Created:** [September 25, 2020, 5:01am UTC](https://forum.ansible.com/t/error-messages/33895 "2020-09-25T05:01:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe3](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@Joe3](https://forum.ansible.com/u/Joe3)\
**Post date:** [September 25, 2020, 5:01am UTC](https://forum.ansible.com/t/error-messages/33895/1 "2020-09-25T05:01:18Z")

</div>

I’m pretty new to ansible, so I’m learning as i go. I run the code below and it seem to work. However i get the following errors messages? Any one know why? Any one have suggestions on how i should re-write it properly?

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [September 25, 2020, 5:43am UTC](https://forum.ansible.com/t/error-messages/33895/2 "2020-09-25T05:43:49Z")

</div>

> I'm pretty new to ansible, so I'm learning as i go. I run the code below and it seem to work. However i get the  
> following errors messages? Any one know why? Any one have suggestions on how i should re-write it properly?  
> ---------------------------------------------------------  
> ----------- C O D E ----------------------------
> 
> ---  
> - name: Removing Access list from Vlan 7  
> ios\_config:  
> parents: "interface {{ item }}"  
> lines:  
> - no ip access-group 100 in  
> when: hostvars[inventory\_hostname]["ansible\_facts"]["net\_interfaces"]["{{ item }}"] is defined  
> loop:  
> - "Vlan7"  
> - "Vlan12"  
> - "Vlan253"  
> - "Vlan254"  
> - "Vlan250"  
> - "Vlan2007"  
> - "Vlan2012"  
> - "Vlan2253"  
> - "Vlan2254"  
> - "Vlan2250"
> 
> --------------------------Error---------------------------------------------------  
> [WARNING]: conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found:  
> hostvars[inventory\_hostname]["ansible\_facts"]["net\_interfaces"]["{{ item }}"] is defined
> 
> [WARNING]: conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found:  
> hostvars[inventory\_hostname]["ansible\_facts"]["net\_interfaces"]["{{ item }}"] is defined

Hello Joe,

don't use curly braces in when:, it is automatically evaluated as Jinja.

&nbsp;&nbsp;&nbsp;&nbsp;hostvars[inventory\_hostname]["ansible\_facts"]["net\_interfaces"][item] is defined

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![Joe3](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@Joe3](https://forum.ansible.com/u/Joe3)\
**Post date:** [September 26, 2020, 5:08am UTC](https://forum.ansible.com/t/error-messages/33895/3 "2020-09-26T05:08:06Z")

</div>

Thank you for your assistance Sir.
