From 1df56c07d32e37748e956c9d9d8c2cccc7a5190b Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Mon, 25 Feb 2013 22:26:16 +0100 Subject: [PATCH] If expand_lists is true, make lookup plugin result into a string Fixes #2196. --- lib/ansible/utils/template.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/utils/template.py b/lib/ansible/utils/template.py index c17eab48a8..6401c33a36 100644 --- a/lib/ansible/utils/template.py +++ b/lib/ansible/utils/template.py @@ -173,6 +173,8 @@ def _varFind(basedir, text, vars, lookup_fatal, depth, expand_lists): if instance is not None: try: replacement = instance.run(args, inject=vars) + if expand_lists: + replacement = u",".join([unicode(x) for x in replacement]) except errors.AnsibleError: if not lookup_fatal: replacement = None