# variable interpolation does not work when name is not used but does otherwise

**URL:** <https://forum.ansible.com/t/variable-interpolation-does-not-work-when-name-is-not-used-but-does-otherwise/12151>\
**Category:** Ansible Project\
**Created:** [December 19, 2012, 11:40pm UTC](https://forum.ansible.com/t/variable-interpolation-does-not-work-when-name-is-not-used-but-does-otherwise/12151 "2012-12-19T23:40:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Nguyen](https://avatars.discourse-cdn.com/v4/letter/j/48db29/32.png) [@James\_Nguyen](https://forum.ansible.com/u/James_Nguyen)\
**Post date:** [December 19, 2012, 11:40pm UTC](https://forum.ansible.com/t/variable-interpolation-does-not-work-when-name-is-not-used-but-does-otherwise/12151/1 "2012-12-19T23:40:24Z")

</div>

#- name: user authorized\_keys

- authorized\_key: user=${item} key=‘$FILE(${playbook\_files\_private}/keys/${item}\_id\_rsa.pub)’  
with\_items: $shell\_accounts  
tags:
- user

the config above yields:  
ERROR: /etc/ansible/files\_private/keys/\_id\_rsa.pub does not exist

---

<div class="post-metadata">

**Author:** ![Daniel\_Hokka\_Zakriss](https://avatars.discourse-cdn.com/v4/letter/d/f05b48/32.png) [@Daniel\_Hokka\_Zakriss](https://forum.ansible.com/u/Daniel_Hokka_Zakriss)\
**Post date:** [December 20, 2012, 8:13am UTC](https://forum.ansible.com/t/variable-interpolation-does-not-work-when-name-is-not-used-but-does-otherwise/12151/2 "2012-12-20T08:13:06Z")

</div>

James Nguyễn wrote:

> #- name: user authorized\_keys  
> - authorized\_key: user=${item}  
> key='$FILE(${playbook\_files\_private}/keys/${item}\_id\_rsa.pub)'  
> &nbsp;&nbsp;with\_items: $shell\_accounts  
> &nbsp;&nbsp;tags:  
> &nbsp;&nbsp;- user
> 
> the config above yields:  
> ERROR: /etc/ansible/files\_private/keys/\_id\_rsa.pub does not exist

What version of ansible? This should be fixed by 3a36c02.

Daniel

---

<div class="post-metadata">

**Author:** ![James\_Nguyen](https://avatars.discourse-cdn.com/v4/letter/j/48db29/32.png) [@James\_Nguyen](https://forum.ansible.com/u/James_Nguyen)\
**Post date:** [December 20, 2012, 7:51pm UTC](https://forum.ansible.com/t/variable-interpolation-does-not-work-when-name-is-not-used-but-does-otherwise/12151/3 "2012-12-20T19:51:15Z")

</div>

You’re right. I was using an older version. Verified and working now with the latest ansible pull.

Thanks!
