# authorized\_key + lookup + with\_items

**URL:** <https://forum.ansible.com/t/authorized-key-lookup-with-items/17764>\
**Category:** Ansible Project\
**Created:** [March 17, 2015, 10:59am UTC](https://forum.ansible.com/t/authorized-key-lookup-with-items/17764 "2015-03-17T10:59:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maciej\_Wawrzynczuk](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@Maciej\_Wawrzynczuk](https://forum.ansible.com/u/Maciej_Wawrzynczuk)\
**Post date:** [March 17, 2015, 10:59am UTC](https://forum.ansible.com/t/authorized-key-lookup-with-items/17764/1 "2015-03-17T10:59:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [March 17, 2015, 12:55pm UTC](https://forum.ansible.com/t/authorized-key-lookup-with-items/17764/2 "2015-03-17T12:55:40Z")

</div>

with\_items (plural) not "with\_item: userlist"

---

<div class="post-metadata">

**Author:** ![Maciej\_Wawrzynczuk](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@Maciej\_Wawrzynczuk](https://forum.ansible.com/u/Maciej_Wawrzynczuk)\
**Post date:** [March 17, 2015, 1:06pm UTC](https://forum.ansible.com/t/authorized-key-lookup-with-items/17764/3 "2015-03-17T13:06:52Z")

</div>

What the shame… 😉  
Thanks.
