How to use eval() method in ansible?

12 views
Skip to first unread message

Sindhuja Durairaj

unread,
Nov 26, 2018, 9:18:24 PM11/26/18
to ansible...@googlegroups.com
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

Brian Coca

unread,
Nov 27, 2018, 10:34:21 PM11/27/18
to ansible...@googlegroups.com
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....')


--
----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages