# Using bare variables is deprecated

**URL:** <https://forum.ansible.com/t/using-bare-variables-is-deprecated/21432>\
**Category:** Ansible Project\
**Created:** [May 13, 2016, 12:17pm UTC](https://forum.ansible.com/t/using-bare-variables-is-deprecated/21432 "2016-05-13T12:17:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Noam\_Greenberg](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Noam\_Greenberg](https://forum.ansible.com/u/Noam_Greenberg)\
**Post date:** [May 13, 2016, 12:17pm UTC](https://forum.ansible.com/t/using-bare-variables-is-deprecated/21432/1 "2016-05-13T12:17:37Z")

</div>

Hi

i try do run my play and i get this “Using bare variables is deprecated” and its work but … not for long

- name: Gather facts  
action: ec2\_facts  
register: ec2\_facts  
tags: test

- name: Add tag to instances  
become: no  
become\_user: root  
local\_action: ec2\_tag resource={{item}} region=us-west-2 state=present  
with\_items: ec2\_facts.ansible\_facts.ansible\_ec2\_instance\_id  
args:  
tags:  
Status: Done  
tags: test

so if i will do what you see i will get this Error and after goole many many docs i found that  
with\_items:{{ ec2\_facts.ansible\_facts.ansible\_ec2\_instance\_id }}

if i just add {{}} to the withe\_items it will work and i dont understand what i missing ?  
what is the 2.0 way to do this ?

Thanks

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [May 13, 2016, 1:50pm UTC](https://forum.ansible.com/t/using-bare-variables-is-deprecated/21432/2 "2016-05-13T13:50:15Z")

</div>

Due to how yaml parses things, you also need to add quotes:

with\_items: “{{ ec2\_facts.ansible\_facts.ansible\_ec2\_instance\_id }}”
