Skip to content

Commit

Permalink
Do not escape backslashes when using the template lookup plugin
Browse files Browse the repository at this point in the history
This brings the lookup plugin inline with what the template module does.

Fixes #26397

(cherry picked from commit cf5fb0a)
  • Loading branch information
abadger committed Jul 5, 2017
1 parent 79fea10 commit a4ceb53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ansible/plugins/lookup/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def run(self, terms, variables, **kwargs):
self._templar.set_available_variables(temp_vars)

# do the templating
res = self._templar.template(template_data, preserve_trailing_newlines=True,convert_data=convert_data_p)
res = self._templar.template(template_data, preserve_trailing_newlines=True,
convert_data=convert_data_p, escape_backslashes=False)
ret.append(res)
else:
raise AnsibleError("the template file %s could not be found for the lookup" % term)
Expand Down

0 comments on commit a4ceb53

Please sign in to comment.