From e0a15d0c503b2eef055b4883f717ecac77379ef1 Mon Sep 17 00:00:00 2001 From: Steven Dossett Date: Mon, 3 Jun 2013 12:42:52 -0400 Subject: [PATCH] Updated to support inventory options from command line --- lib/ansible/runner/lookup_plugins/inventory_hostnames.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/runner/lookup_plugins/inventory_hostnames.py b/lib/ansible/runner/lookup_plugins/inventory_hostnames.py index d88f54b55de..6880887d849 100644 --- a/lib/ansible/runner/lookup_plugins/inventory_hostnames.py +++ b/lib/ansible/runner/lookup_plugins/inventory_hostnames.py @@ -34,12 +34,12 @@ class LookupModule(object): def __init__(self, basedir=None, **kwargs): self.basedir = basedir + self.host_list = kwargs['runner'].inventory.host_list def run(self, terms, inject=None, **kwargs): terms = utils.listify_lookup_plugin_terms(terms, self.basedir, inject) if not isinstance(terms, list): raise errors.AnsibleError("with_inventory_hostnames expects a list") - - return flatten(inventory.Inventory().list_hosts(terms)) + return flatten(inventory.Inventory(self.host_list).list_hosts(terms))