From f2a8c0d6127e85813f07b2fc25b1968b72c3fd7f Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Mon, 13 May 2013 21:31:45 -0400 Subject: [PATCH] Fix listification inside of with_items so it runs more intelligently. --- lib/ansible/utils/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/utils/__init__.py b/lib/ansible/utils/__init__.py index 366bb58fec..8448eb09c0 100644 --- a/lib/ansible/utils/__init__.py +++ b/lib/ansible/utils/__init__.py @@ -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: