# How to use eval() method in ansible?

**URL:** <https://forum.ansible.com/t/how-to-use-eval-method-in-ansible/29119>\
**Category:** Ansible Project\
**Created:** [November 27, 2018, 2:18am UTC](https://forum.ansible.com/t/how-to-use-eval-method-in-ansible/29119 "2018-11-27T02:18:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sindhuja\_Durairaj](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Sindhuja\_Durairaj](https://forum.ansible.com/u/Sindhuja_Durairaj)\
**Post date:** [November 27, 2018, 2:18am UTC](https://forum.ansible.com/t/how-to-use-eval-method-in-ansible/29119/1 "2018-11-27T02:18:01Z")

</div>

Hello Team,

I would like to use eval() method which we use in python to be used in Ansible or in jinja templating. So far, I didn’t get any module for it in Ansible. There is no filter called eval which can be used in jinja templating. Is there any way to achieve it?

Regards,  
Sindhuja D

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 28, 2018, 3:33am UTC](https://forum.ansible.com/t/how-to-use-eval-method-in-ansible/29119/2 "2018-11-28T03:33:51Z")

</div>

Basically, the script module is there to run arbitrary code, or if you  
need to use inline in a play, you can use pipe lookup : lookup('pipe',  
'python -c '\<eval stuff here....')
