From a45c3b84f33121c724264960b29f890c19ab90cc Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 28 Jul 2014 16:21:37 -0500 Subject: [PATCH] Avoid templating raw lookup strings --- lib/ansible/runner/action_plugins/debug.py | 2 +- lib/ansible/utils/__init__.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ansible/runner/action_plugins/debug.py b/lib/ansible/runner/action_plugins/debug.py index d2c0a980abe..98820956572 100644 --- a/lib/ansible/runner/action_plugins/debug.py +++ b/lib/ansible/runner/action_plugins/debug.py @@ -50,7 +50,7 @@ class ActionModule(object): result = dict(failed=True, msg=args['msg']) else: result = dict(msg=args['msg']) - elif 'var' in args: + elif 'var' in args and not utils.LOOKUP_REGEX.search(args['var']): results = template.template(self.basedir, "{{ %s }}" % args['var'], inject) result[args['var']] = results diff --git a/lib/ansible/utils/__init__.py b/lib/ansible/utils/__init__.py index 83b80ab885e..5da39acab79 100644 --- a/lib/ansible/utils/__init__.py +++ b/lib/ansible/utils/__init__.py @@ -1257,7 +1257,10 @@ def listify_lookup_plugin_terms(terms, basedir, inject): # with_items: {{ alist }} stripped = terms.strip() - if not (stripped.startswith('{') or stripped.startswith('[')) and not stripped.startswith("/") and not stripped.startswith('set(['): + if not (stripped.startswith('{') or stripped.startswith('[')) and \ + not stripped.startswith("/") and \ + not stripped.startswith('set([') and \ + not LOOKUP_REGEX.search(terms): # if not already a list, get ready to evaluate with Jinja2 # not sure why the "/" is in above code :) try: