authorized_key and $FILE macro

Hi,

I performed some simple tests with the authorized_key and $FILE macro and it seems to me that the $FILE macro needs to be quoted:

tasks:
    - authorized_key user=$item key=**"**$FILE(/keys/$user1)**"**
      with_items:
         - pinky
         - brain
         - snowball

without the quote I have the following error:
{“failed”: true, “msg”: “this module requires key=value arguments”}

In the docs it is mentionned twice without the quotes…
Getting values from files (here also the parameter name should be user)

authorized_key module documentation

It might be because the SSH key has a space in it, but I'll check to make sure.

Can you file a github ticket so we can look at this for the docs?

github.com/ansible/ansible

Thanks!

I had this very problem, using a variable containing the key. You indeed need to quote it as it has a space in it.

Serge