Ansible 0.8 :: $FILE macro :: failed

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

make that

action: authorized_key user=root key=/root/ansible/keys/${item}

Serge

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.

        -JP

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

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.

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!