# How to use look-up plugin in ansible roles

**URL:** <https://forum.ansible.com/t/how-to-use-look-up-plugin-in-ansible-roles/35174>\
**Category:** Ansible Project\
**Created:** [May 16, 2021, 9:45am UTC](https://forum.ansible.com/t/how-to-use-look-up-plugin-in-ansible-roles/35174 "2021-05-16T09:45:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Komal\_Suthar](https://avatars.discourse-cdn.com/v4/letter/k/919ad9/32.png) [@Komal\_Suthar](https://forum.ansible.com/u/Komal_Suthar)\
**Post date:** [May 16, 2021, 9:45am UTC](https://forum.ansible.com/t/how-to-use-look-up-plugin-in-ansible-roles/35174/1 "2021-05-16T09:45:10Z")

</div>

Hello,  
I want to use look-up plugin to read a file in the roles so i kept that file in files folder and using the look-up in tasks/main file but it is not working anybody can help?

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [May 16, 2021, 9:53am UTC](https://forum.ansible.com/t/how-to-use-look-up-plugin-in-ansible-roles/35174/2 "2021-05-16T09:53:59Z")

</div>

> Hello,  
> I want to use look-up plugin to read a file in the roles so i kept that

file in files folder and using the look-up in

> tasks/main file but it is not working anybody can help?

Please post the code in tasks/main.yml and the error message / expected outcome.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![Komal\_Suthar](https://avatars.discourse-cdn.com/v4/letter/k/919ad9/32.png) [@Komal\_Suthar](https://forum.ansible.com/u/Komal_Suthar)\
**Post date:** [May 16, 2021, 10:07am UTC](https://forum.ansible.com/t/how-to-use-look-up-plugin-in-ansible-roles/35174/3 "2021-05-16T10:07:25Z")

</div>

Is the error coming from the k8s…?

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [May 16, 2021, 10:18am UTC](https://forum.ansible.com/t/how-to-use-look-up-plugin-in-ansible-roles/35174/4 "2021-05-16T10:18:27Z")

</div>

> Is the error coming from the k8s..?

My crystal ball crashed, so no way to figure out your problem based on your minimal input.

Bye  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

> &nbsp;&nbsp;&nbsp;&nbsp;\> Hello,  
> &nbsp;&nbsp;&nbsp;&nbsp;\> I want to use look-up plugin to read a file in the roles so i kept that  
> &nbsp;&nbsp;&nbsp;&nbsp;file in files folder and using the look-up in  
> &nbsp;&nbsp;&nbsp;&nbsp;\> tasks/main file but it is not working anybody can help?  
> &nbsp;&nbsp;&nbsp;&nbsp;\>
> 
> &nbsp;&nbsp;&nbsp;&nbsp;Please post the code in tasks/main.yml and the error message / expected outcome.
> 
> &nbsp;&nbsp;&nbsp;&nbsp;Regards  
> &nbsp;&nbsp;&nbsp;&nbsp; Racke
> 
> &nbsp;&nbsp;&nbsp;&nbsp;\> --  
> &nbsp;&nbsp;&nbsp;&nbsp;\> You received this message because you are subscribed to the Google Groups "Ansible Project" group.  
> &nbsp;&nbsp;&nbsp;&nbsp;\> To unsubscribe from this group and stop receiving emails from it,

send an email to
