diff --git a/lib/ansible/runner/lookup_plugins/nested.py b/lib/ansible/runner/lookup_plugins/nested.py index 28775746ef..29c4a7d21c 100644 --- a/lib/ansible/runner/lookup_plugins/nested.py +++ b/lib/ansible/runner/lookup_plugins/nested.py @@ -45,12 +45,8 @@ class LookupModule(object): def __lookup_injects(self, terms, inject): results = [] for x in terms: - if isinstance(x, basestring) and x in inject: - results.append(inject[x]) - elif isinstance(x, basestring): - raise errors.AnsibleError("cannot resolve: %s" % x) - else: - results.append(x) + intermediate = utils.listify_lookup_plugin_terms(x, self.basedir, inject) + results.append(intermediate) return results def run(self, terms, inject=None, **kwargs): diff --git a/lib/ansible/runner/lookup_plugins/together.py b/lib/ansible/runner/lookup_plugins/together.py index 173ee4e0fc..07332c9fb9 100644 --- a/lib/ansible/runner/lookup_plugins/together.py +++ b/lib/ansible/runner/lookup_plugins/together.py @@ -45,10 +45,8 @@ class LookupModule(object): def __lookup_injects(self, terms, inject): results = [] for x in terms: - if isinstance(x, basestring) and x in inject: - results.append(inject[x]) - else: - results.append(x) + intermediate = utils.listify_lookup_plugin_terms(x, self.basedir, inject) + results.append(intermediate) return results def run(self, terms, inject=None, **kwargs):