mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
Allow jinja2 evals that produce lists to be used in with_items. Ideally want something a bit less heavy
than the eval here.
This commit is contained in:
parent
e8085ad40c
commit
fecfbf9226
2 changed files with 23 additions and 4 deletions
|
@ -31,5 +31,11 @@ class LookupModule(object):
|
|||
|
||||
def run(self, terms, **kwargs):
|
||||
if isinstance(terms, basestring):
|
||||
if '{' or '[' in terms:
|
||||
# Jinja2-ified list needs to be converted back to a real type
|
||||
# TODO: something a bit less heavy than eval
|
||||
terms = eval(terms)
|
||||
terms = [ terms ]
|
||||
return flatten(terms)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue