From cf5fb0acdf37e710fd3a4dc0780defa1a56789dc Mon Sep 17 00:00:00 2001
From: Toshio Kuratomi <a.badger@gmail.com>
Date: Wed, 5 Jul 2017 15:48:01 -0700
Subject: [PATCH] Do not escape backslashes when using the template lookup
 plugin

This brings the lookup plugin inline with what the template module does.

Fixes #26397
---
 lib/ansible/plugins/lookup/template.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/ansible/plugins/lookup/template.py b/lib/ansible/plugins/lookup/template.py
index 09fd355e3d3..27a4bd2486f 100644
--- a/lib/ansible/plugins/lookup/template.py
+++ b/lib/ansible/plugins/lookup/template.py
@@ -68,7 +68,8 @@ class LookupModule(LookupBase):
                     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)