authorized_key + lookup + with_items

304 views
Skip to first unread message

Maciej Wawrzyńczuk

unread,
Mar 17, 2015, 8:42:44 AM3/17/15
to ansible...@googlegroups.com
Hi,

I have problem I cannot manage.
When I try to use authorized_key module in loop with lookup i have error:

ERROR: cannot find lookup plugin named item for usage in with_item

this is my code:

- name: User key
  authorized_key: user="{{ item }}"
                  key="{{ lookup('file', 'pub_keys/' + item + '.txt') }}"
  with_item: userlist
  tags:
    - user
    - admin

I'm testing lookup alone:

- debug: msg="{{ lookup('file', 'pub_keys/' + item + '.txt') }}"
  with_items: userlist

and its works fine. What I,am doing wrong?

Thanks in advance, M.

Brian Coca

unread,
Mar 17, 2015, 8:55:43 AM3/17/15
to ansible...@googlegroups.com
with_items (plural) not "with_item: userlist"



--
Brian Coca

Maciej Wawrzyńczuk

unread,
Mar 17, 2015, 9:06:52 AM3/17/15
to ansible...@googlegroups.com
What the shame... ;)
Thanks.
Reply all
Reply to author
Forward
0 new messages