# Ansible 0.8 :: $FILE macro :: failed

**URL:** <https://forum.ansible.com/t/ansible-0-8-file-macro-failed/12084>\
**Category:** Ansible Project\
**Created:** [November 14, 2012, 4:30am UTC](https://forum.ansible.com/t/ansible-0-8-file-macro-failed/12084 "2012-11-14T04:30:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tchoum](https://avatars.discourse-cdn.com/v4/letter/t/dc4da7/32.png) [@Tchoum](https://forum.ansible.com/u/Tchoum)\
**Post date:** [November 14, 2012, 4:30am UTC](https://forum.ansible.com/t/ansible-0-8-file-macro-failed/12084/1 "2012-11-14T04:30:37Z")

</div>

Hello!

I try to deploy ssh keys :

- name: Install SSH keys  
action: authorized\_key user=root key=$FILE(/root/ansible/keys/${item})  
with\_items:
- user1
- user2
- user3  
tags: install\_ssh\_keys

but i get :

ERROR: $FILE(/root/ansible/keys/) failed

The item variables does not seem to be interpreted, or maybe I’m using the FILE macro in the wrong way?

Thank you

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [November 14, 2012, 6:24am UTC](https://forum.ansible.com/t/ansible-0-8-file-macro-failed/12084/2 "2012-11-14T06:24:30Z")

</div>

make that

action: authorized\_key user=root key=/root/ansible/keys/${item}

Serge

---

<div class="post-metadata">

**Author:** ![jpmens1](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@jpmens1](https://forum.ansible.com/u/jpmens1)\
**Post date:** [November 14, 2012, 6:44am UTC](https://forum.ansible.com/t/ansible-0-8-file-macro-failed/12084/3 "2012-11-14T06:44:46Z")

</div>

> action: authorized\_key user=root key=/root/ansible/keys/${item}

No. key= takes the SSH public key as a string. The OP wants to use the  
file's content as that string.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-JP

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [November 14, 2012, 7:22am UTC](https://forum.ansible.com/t/ansible-0-8-file-macro-failed/12084/4 "2012-11-14T07:22:47Z")

</div>

ah, right, sorry about that. need to wake up

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [November 14, 2012, 2:15pm UTC](https://forum.ansible.com/t/ansible-0-8-file-macro-failed/12084/5 "2012-11-14T14:15:31Z")

</div>

It seems there's a bug in the code right now where all the lookup  
plugins ($FILE, etc) evaluate too early.

They need to evaluate dead last in the cycle.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [November 14, 2012, 2:39pm UTC](https://forum.ansible.com/t/ansible-0-8-file-macro-failed/12084/6 "2012-11-14T14:39:57Z")

</div>

Daniel has pushed a change that should fix this, I'd suggest checking it out.

It doesn't quite evaluate it last, but should hopefully solve the problem.

If not, let us know!
