mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00: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:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user