From b09f1f8e0b4375e0885db0f309fec2a37a1ae51a Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Wed, 22 Jul 2015 00:08:32 -0400 Subject: [PATCH] Account for filters in bare variable conversion Fixes #11530 --- lib/ansible/template/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/template/__init__.py b/lib/ansible/template/__init__.py index f10ea22fb5b..3b0bafdbd6d 100644 --- a/lib/ansible/template/__init__.py +++ b/lib/ansible/template/__init__.py @@ -211,8 +211,9 @@ class Templar: ''' if isinstance(variable, basestring): - first_part = variable.split(".")[0].split("[")[0] - if first_part in self._available_variables and self.environment.variable_start_string not in variable: + contains_filters = "|" in variable + first_part = variable.split("|")[0].split(".")[0].split("[")[0] + if (contains_filters or first_part in self._available_variables) and self.environment.variable_start_string not in variable: return "%s%s%s" % (self.environment.variable_start_string, variable, self.environment.variable_end_string) # the variable didn't meet the conditions to be converted,