mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix listification inside of with_items so it runs more intelligently.
This commit is contained in:
parent
161f3e3670
commit
f2a8c0d612
1 changed files with 4 additions and 1 deletions
|
@ -764,7 +764,10 @@ def listify_lookup_plugin_terms(terms, basedir, inject):
|
|||
# OR
|
||||
# with_items: {{ alist }}
|
||||
|
||||
if not '{' in terms and not '[' in terms and not terms.strip().startswith("/"):
|
||||
stripped = terms.strip()
|
||||
if not (stripped.startswith('{') or stripped.startswith('[')) and not stripped.startswith("/"):
|
||||
# if not already a list, get ready to evaluate with Jinja2
|
||||
# not sure why the "/" is in above code :)
|
||||
try:
|
||||
new_terms = template.template(basedir, "{{ %s }}" % terms, inject)
|
||||
if isinstance(new_terms, basestring) and new_terms.find("{{") != -1:
|
||||
|
|
Loading…
Reference in a new issue